Skip to content

Instantly share code, notes, and snippets.

@davidtwco
Created July 21, 2022 13:18
Show Gist options
  • Save davidtwco/372742650b4ac207e7c9c320ca50aa0d to your computer and use it in GitHub Desktop.
Save davidtwco/372742650b4ac207e7c9c320ca50aa0d to your computer and use it in GitHub Desktop.
// ignore-lldb
// Regression test that functions which start with a macro invocation have line information which
// start from the first line.
// compile-flags:-g -Zdebug-macros
// === GDB TESTS ===================================================================================
// gdb-command:run
// gdb-command:next
// gdb-command:frame
// gdb-check:[...]#loc1[...]
// gdb-command:continue
fn one() {
println!("one");
}
fn two() {
println!("two");
}
fn three() {
println!("three");
}
macro_rules! outer {
($b:block) => {
one(); // #loc1
inner!();
$b
};
}
macro_rules! inner {
() => {
two();
};
}
fn main() {
outer!({
three();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment