]> git.lizzy.rs Git - rust.git/blob - src/test/ui/thread-local/tls.rs
Merge commit 'c4416f20dcaec5d93077f72470e83e150fb923b1' into sync-rustfmt
[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 }