Skip to content

Commit b89a0a7

Browse files
committed
Add debuginfo tests for collapse_debuginfo for statics.
1 parent 9c25d40 commit b89a0a7

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ ignore-lldb
2+
3+
// Test that static debug info is not collapsed with #[collapse_debuginfo(external)]
4+
5+
//@ compile-flags:-g
6+
7+
// === GDB TESTS ===================================================================================
8+
9+
// gdb-command:info line collapse_debuginfo_static_external::FOO
10+
// gdb-check:[...]Line 15[...]
11+
12+
#[collapse_debuginfo(external)]
13+
macro_rules! decl_foo {
14+
() => {
15+
static FOO: u32 = 0;
16+
};
17+
}
18+
19+
decl_foo!();
20+
21+
fn main() {
22+
// prevent FOO from getting optimized out
23+
std::hint::black_box(&FOO);
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ ignore-lldb
2+
3+
// Test that static debug info is collapsed with #[collapse_debuginfo(yes)]
4+
5+
//@ compile-flags:-g
6+
7+
// === GDB TESTS ===================================================================================
8+
9+
// gdb-command:info line collapse_debuginfo_static::FOO
10+
// gdb-check:[...]Line 19[...]
11+
12+
#[collapse_debuginfo(yes)]
13+
macro_rules! decl_foo {
14+
() => {
15+
static FOO: u32 = 0;
16+
};
17+
}
18+
19+
decl_foo!();
20+
21+
fn main() {
22+
// prevent FOO from getting optimized out
23+
std::hint::black_box(&FOO);
24+
}

0 commit comments

Comments
 (0)