diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-05-26 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-05-27 18:36:32 +0200 |
| commit | e4b7d2c5071d1066159702d8176c6d87d843403e (patch) | |
| tree | 94ff45c970a4e56b981dd065add3f01486026dbc /src/test/codegen | |
| parent | aeca4d6428c52cbf2c8d1f28657b0bdf92e4ea7c (diff) | |
| download | rust-e4b7d2c5071d1066159702d8176c6d87d843403e.tar.gz rust-e4b7d2c5071d1066159702d8176c6d87d843403e.zip | |
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.
Diffstat (limited to 'src/test/codegen')
| -rw-r--r-- | src/test/codegen/debug-linkage-name.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/codegen/debug-linkage-name.rs b/src/test/codegen/debug-linkage-name.rs new file mode 100644 index 00000000000..0d7dca3aba3 --- /dev/null +++ b/src/test/codegen/debug-linkage-name.rs @@ -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() {} +} |
