]> git.lizzy.rs Git - rust.git/blob - src/test/ui/tls.rs
Auto merge of #85556 - FabianWolff:issue-85071, r=estebank,jackh726
[rust.git] / src / test / ui / 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 }