forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#126365 - Dirbaio:collapse-debuginfo-statics…
…, r=workingjubilee Honor collapse_debuginfo for statics. fixes rust-lang#126363 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> -->
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//@ ignore-lldb | ||
|
||
// Test that static debug info is not collapsed with #[collapse_debuginfo(external)] | ||
|
||
//@ compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:info line collapse_debuginfo_static_external::FOO | ||
// gdb-check:[...]Line 15[...] | ||
|
||
#[collapse_debuginfo(external)] | ||
macro_rules! decl_foo { | ||
() => { | ||
static FOO: u32 = 0; | ||
}; | ||
} | ||
|
||
decl_foo!(); | ||
|
||
fn main() { | ||
// prevent FOO from getting optimized out | ||
std::hint::black_box(&FOO); | ||
} |
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,24 @@ | ||
//@ ignore-lldb | ||
|
||
// Test that static debug info is collapsed with #[collapse_debuginfo(yes)] | ||
|
||
//@ compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:info line collapse_debuginfo_static::FOO | ||
// gdb-check:[...]Line 19[...] | ||
|
||
#[collapse_debuginfo(yes)] | ||
macro_rules! decl_foo { | ||
() => { | ||
static FOO: u32 = 0; | ||
}; | ||
} | ||
|
||
decl_foo!(); | ||
|
||
fn main() { | ||
// prevent FOO from getting optimized out | ||
std::hint::black_box(&FOO); | ||
} |