Skip to content

Commit a2d328f

Browse files
committed
test: demonstrate that dwarf debug names sections are emitted
1 parent 5701093 commit a2d328f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

tests/assembly/dwarf4.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Makes sure that `-Z dwarf-version=4` causes `rustc` to emit DWARF version 4.
2+
// assembly-output: emit-asm
3+
// compile-flags: -g --target x86_64-unknown-linux-gnu -Z dwarf-version=4 -Copt-level=0
4+
// needs-llvm-components: x86
5+
6+
#![feature(no_core, lang_items)]
7+
#![crate_type = "rlib"]
8+
#![no_core]
9+
10+
#[lang = "sized"]
11+
trait Sized {}
12+
#[lang = "copy"]
13+
trait Copy {}
14+
15+
pub fn wibble() {}
16+
17+
pub struct X;
18+
19+
// CHECK: .section .debug_info
20+
// CHECK-NOT: .short 2
21+
// CHECK-NOT: .short 5
22+
// CHECK: .short 4
23+
// CHECK: .section .debug_pubnames
24+
// CHECK: .section .debug_pubtypes

tests/assembly/dwarf5.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ pub fn wibble() {}
1818
// CHECK-NOT: .short 2
1919
// CHECK-NOT: .short 4
2020
// CHECK: .short 5
21+
// CHECK: .section .debug_names

0 commit comments

Comments
 (0)