diff options
Diffstat (limited to 'tests/ui/thread-local/auxiliary/tls-rlib.rs')
-rw-r--r-- | tests/ui/thread-local/auxiliary/tls-rlib.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/thread-local/auxiliary/tls-rlib.rs b/tests/ui/thread-local/auxiliary/tls-rlib.rs new file mode 100644 index 000000000..20bc998ec --- /dev/null +++ b/tests/ui/thread-local/auxiliary/tls-rlib.rs @@ -0,0 +1,15 @@ +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![feature(thread_local)] +#![feature(cfg_target_thread_local)] + +#[cfg(target_thread_local)] +#[thread_local] +pub static BAR: bool = true; + +#[cfg(target_thread_local)] +#[inline(never)] +pub fn bar_addr() -> usize { + &BAR as *const bool as usize +} |