2016-08-25 02:34:31 +00:00
|
|
|
//@ ignore-android
|
2016-11-30 17:17:38 +00:00
|
|
|
//@ ignore-aarch64
|
2024-08-15 21:04:26 +00:00
|
|
|
//@ min-lldb-version: 1800
|
2024-08-13 22:20:48 +00:00
|
|
|
//@ min-gdb-version: 13.0
|
2016-08-25 02:34:31 +00:00
|
|
|
|
|
|
|
//@ aux-build:macro-stepping.rs
|
|
|
|
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate macro_stepping; // exports new_scope!()
|
|
|
|
|
2024-08-10 02:33:40 +00:00
|
|
|
//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts
|
2024-08-15 21:04:26 +00:00
|
|
|
// SingleUseConsts shouldn't need to be disabled, see #128945
|
2016-08-25 02:34:31 +00:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc1[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc2[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc3[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc4[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc5[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#loc6[...]
|
|
|
|
|
2017-02-09 06:09:51 +00:00
|
|
|
// gdb-command:continue
|
|
|
|
// gdb-command:step
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#inc-loc1[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#inc-loc2[...]
|
|
|
|
// gdb-command:next
|
|
|
|
// gdb-command:frame
|
|
|
|
// gdb-check:[...]#inc-loc3[...]
|
|
|
|
|
2016-08-25 02:34:31 +00:00
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:set set stop-line-count-before 0
|
|
|
|
// lldb-command:set set stop-line-count-after 1
|
|
|
|
// Can't set both to zero or lldb will stop printing source at all. So it will output the current
|
|
|
|
// line and the next. We deal with this by having at least 2 lines between the #loc's
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #loc1 [...]
|
2016-08-25 02:34:31 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #loc2 [...]
|
2016-08-25 02:34:31 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #loc3 [...]
|
2016-08-25 02:34:31 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #loc4 [...]
|
2016-08-25 02:34:31 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #loc5 [...]
|
2016-08-25 02:34:31 +00:00
|
|
|
|
2017-02-09 06:09:51 +00:00
|
|
|
// lldb-command:continue
|
|
|
|
// lldb-command:step
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #inc-loc1 [...]
|
2017-02-09 06:09:51 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #inc-loc2 [...]
|
2017-02-09 06:09:51 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #inc-loc1 [...]
|
2023-04-22 22:34:46 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #inc-loc2 [...]
|
2023-04-22 22:34:46 +00:00
|
|
|
// lldb-command:next
|
|
|
|
// lldb-command:frame select
|
2024-03-10 13:55:58 +00:00
|
|
|
// lldb-check:[...] #inc-loc3 [...]
|
2017-02-09 06:09:51 +00:00
|
|
|
|
2024-04-26 01:11:05 +00:00
|
|
|
#[collapse_debuginfo(yes)]
|
2016-08-25 02:34:31 +00:00
|
|
|
macro_rules! foo {
|
|
|
|
() => {
|
2023-04-22 22:34:46 +00:00
|
|
|
let a = 1; opaque(a);
|
|
|
|
let b = 2; opaque(b);
|
|
|
|
let c = 3; opaque(c);
|
|
|
|
};
|
2016-08-25 02:34:31 +00:00
|
|
|
}
|
|
|
|
|
2024-04-26 01:11:05 +00:00
|
|
|
#[collapse_debuginfo(yes)]
|
2016-08-25 02:34:31 +00:00
|
|
|
macro_rules! foo2 {
|
|
|
|
() => {
|
|
|
|
foo!();
|
2023-04-22 22:34:46 +00:00
|
|
|
let x = 1; opaque(x);
|
2016-08-25 02:34:31 +00:00
|
|
|
foo!();
|
2023-04-22 22:34:46 +00:00
|
|
|
};
|
2016-08-25 02:34:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
zzz(); // #break
|
|
|
|
|
|
|
|
foo!(); // #loc1
|
|
|
|
|
|
|
|
foo2!(); // #loc2
|
|
|
|
|
|
|
|
let x = vec![42]; // #loc3
|
|
|
|
|
|
|
|
new_scope!(); // #loc4
|
|
|
|
|
|
|
|
println!("Hello {}", // #loc5
|
|
|
|
"world");
|
|
|
|
|
|
|
|
zzz(); // #loc6
|
2017-02-09 06:09:51 +00:00
|
|
|
|
|
|
|
included(); // #break
|
2016-08-25 02:34:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|
2017-02-09 06:09:51 +00:00
|
|
|
|
2023-04-22 22:34:46 +00:00
|
|
|
fn opaque(_: u32) {}
|
|
|
|
|
2017-02-09 06:09:51 +00:00
|
|
|
include!("macro-stepping.inc");
|