]> git.lizzy.rs Git - rust.git/blob - src/test/ui/thread-local/tls.rs
Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup
[rust.git] / src / test / ui / thread-local / tls.rs
1 // run-pass
2 // ignore-emscripten no threads support
3 // compile-flags: -O
4
5 #![feature(thread_local)]
6
7 #[thread_local]
8 static S: u32 = 222;
9
10 fn main() {
11     let local = &S as *const u32 as usize;
12     let foreign = std::thread::spawn(|| &S as *const u32 as usize).join().unwrap();
13     assert_ne!(local, foreign);
14 }