2020-05-25 19:00:00 -05:00
|
|
|
// Verifies that linkage name is omitted when it is
|
|
|
|
// the same as variable / function name.
|
|
|
|
//
|
2024-02-22 06:10:29 -06:00
|
|
|
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
|
|
|
//@ compile-flags: -C debuginfo=2 -Copt-level=0
|
2020-05-25 19:00:00 -05:00
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
pub mod xyz {
|
|
|
|
// CHECK: !DIGlobalVariable(name: "A",
|
|
|
|
// CHECK: linkageName:
|
|
|
|
// CHECK-SAME: line: 12,
|
|
|
|
pub static A: u32 = 1;
|
|
|
|
|
|
|
|
// CHECK: !DIGlobalVariable(name: "B",
|
|
|
|
// CHECK-NOT: linkageName:
|
|
|
|
// CHECK-SAME: line: 18,
|
|
|
|
#[no_mangle]
|
|
|
|
pub static B: u32 = 2;
|
|
|
|
|
|
|
|
// CHECK: !DIGlobalVariable(name: "C",
|
|
|
|
// CHECK-NOT: linkageName:
|
|
|
|
// CHECK-SAME: line: 24,
|
|
|
|
#[export_name = "C"]
|
|
|
|
pub static C: u32 = 2;
|
|
|
|
|
|
|
|
// CHECK: !DISubprogram(name: "e",
|
|
|
|
// CHECK: linkageName:
|
|
|
|
// CHECK-SAME: line: 29,
|
2020-09-01 16:28:11 -05:00
|
|
|
pub extern "C" fn e() {}
|
2020-05-25 19:00:00 -05:00
|
|
|
|
|
|
|
// CHECK: !DISubprogram(name: "f",
|
|
|
|
// CHECK-NOT: linkageName:
|
|
|
|
// CHECK-SAME: line: 35,
|
|
|
|
#[no_mangle]
|
2020-09-01 16:28:11 -05:00
|
|
|
pub extern "C" fn f() {}
|
2020-05-25 19:00:00 -05:00
|
|
|
|
|
|
|
// CHECK: !DISubprogram(name: "g",
|
|
|
|
// CHECK-NOT: linkageName:
|
|
|
|
// CHECK-SAME: line: 41,
|
|
|
|
#[export_name = "g"]
|
2020-09-01 16:28:11 -05:00
|
|
|
pub extern "C" fn g() {}
|
2020-05-25 19:00:00 -05:00
|
|
|
}
|