1
Fork 0

codegen: allow the dso_local attribute

The attribute is injected into most items when static relocation is
enabled in a target.
This commit is contained in:
Pietro Albini 2023-05-23 15:26:31 +02:00
parent 5fdeae610d
commit dc1ed9ddd7
No known key found for this signature in database
GPG key ID: CD76B35F7734769E
9 changed files with 50 additions and 50 deletions

View file

@ -3,7 +3,7 @@
#![crate_type = "lib"]
// CHECK: @VAR1 = constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one"
// CHECK: @VAR1 = {{(dso_local )?}}constant <{ [4 x i8] }> <{ [4 x i8] c"\01\00\00\00" }>, section ".test_one"
#[no_mangle]
#[link_section = ".test_one"]
#[cfg(target_endian = "little")]
@ -19,17 +19,17 @@ pub enum E {
B(f32)
}
// CHECK: @VAR2 = constant {{.*}}, section ".test_two"
// CHECK: @VAR2 = {{(dso_local )?}}constant {{.*}}, section ".test_two"
#[no_mangle]
#[link_section = ".test_two"]
pub static VAR2: E = E::A(666);
// CHECK: @VAR3 = constant {{.*}}, section ".test_three"
// CHECK: @VAR3 = {{(dso_local )?}}constant {{.*}}, section ".test_three"
#[no_mangle]
#[link_section = ".test_three"]
pub static VAR3: E = E::B(1.);
// CHECK: define void @fn1() {{.*}} section ".test_four" {
// CHECK: define {{(dso_local )?}}void @fn1() {{.*}} section ".test_four" {
#[no_mangle]
#[link_section = ".test_four"]
pub fn fn1() {}