2021-05-15 06:01:13 -05:00
|
|
|
//@ compile-flags:-g
|
2023-02-27 19:21:15 -06:00
|
|
|
//@ edition:2021
|
2021-05-15 06:01:13 -05:00
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// gdb-command:run
|
|
|
|
// gdb-command:print my_ref__my_field1
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$1 = 11
|
2021-05-15 06:01:13 -05:00
|
|
|
// gdb-command:continue
|
|
|
|
// gdb-command:print my_var__my_field2
|
2024-08-17 16:31:49 -05:00
|
|
|
// gdb-check:$2 = 22
|
2021-05-15 06:01:13 -05:00
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v my_ref__my_field1
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:(unsigned int) my_ref__my_field1 = 11
|
2021-05-15 06:01:13 -05:00
|
|
|
// lldb-command:continue
|
2024-03-15 09:05:57 -05:00
|
|
|
// lldb-command:v my_var__my_field2
|
2024-08-18 16:00:33 -05:00
|
|
|
// lldb-check:(unsigned int) my_var__my_field2 = 22
|
2021-05-15 06:01:13 -05:00
|
|
|
// lldb-command:continue
|
|
|
|
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
struct MyStruct {
|
|
|
|
my_field1: u32,
|
|
|
|
my_field2: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2023-02-27 19:21:15 -06:00
|
|
|
let mut my_var = MyStruct { my_field1: 11, my_field2: 22 };
|
2021-05-15 06:01:13 -05:00
|
|
|
let my_ref = &mut my_var;
|
|
|
|
|
|
|
|
let test = || {
|
|
|
|
let a = my_ref.my_field1;
|
|
|
|
|
|
|
|
_zzz(); // #break
|
|
|
|
};
|
|
|
|
|
|
|
|
test();
|
|
|
|
|
|
|
|
let test = move || {
|
|
|
|
let a = my_var.my_field2;
|
|
|
|
|
|
|
|
_zzz(); // #break
|
|
|
|
};
|
|
|
|
|
|
|
|
test();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn _zzz() {}
|