1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-tidy-linelength
16 #![crate_type = "rlib"]
17 #![feature(thread_local)]
19 // CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4
22 static mut STATIC_VAR_1: [u32; 8] = [0; 8];
24 // CHECK: @STATIC_VAR_2 = thread_local local_unnamed_addr global <{ [32 x i8] }> <{{[^>]*}}>, section "__DATA,__thread_data", align 4
27 static mut STATIC_VAR_2: [u32; 8] = [4; 8];
30 pub unsafe fn f(x: &mut [u32; 8]) {
31 std::mem::swap(x, &mut STATIC_VAR_1)
35 pub unsafe fn g(x: &mut [u32; 8]) {
36 std::mem::swap(x, &mut STATIC_VAR_2)