-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Omit DW_AT_linkage_name when it is the same as DW_AT_name
The DWARF standard suggests that it might be useful to include `DW_AT_linkage_name` when it is *distinct* from the identifier name.
- Loading branch information
Showing
3 changed files
with
48 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Verifies that linkage name is omitted when it is | ||
// the same as variable / function name. | ||
// | ||
// compile-flags: -C no-prepopulate-passes | ||
// compile-flags: -C debuginfo=2 | ||
#![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, | ||
pub extern fn e() {} | ||
|
||
// CHECK: !DISubprogram(name: "f", | ||
// CHECK-NOT: linkageName: | ||
// CHECK-SAME: line: 35, | ||
#[no_mangle] | ||
pub extern fn f() {} | ||
|
||
// CHECK: !DISubprogram(name: "g", | ||
// CHECK-NOT: linkageName: | ||
// CHECK-SAME: line: 41, | ||
#[export_name = "g"] | ||
pub extern fn g() {} | ||
} |