mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
60 lines
1.3 KiB
Rust
60 lines
1.3 KiB
Rust
//@ revisions: msvc
|
|
|
|
// On MSVC, this test requires LLDB to be able to read `S_DEFRANGE_REGISTER_REL_INDIR` PDB nodes,
|
|
// which is only possible on lldb 23.1+
|
|
//@ [msvc] only-msvc
|
|
//@ [msvc] min-llvm-lldb-version: 23.1.0
|
|
|
|
//@ compile-flags:-g
|
|
//@ edition:2021
|
|
//@ ignore-backends: gcc
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
//@ gdb-command:run
|
|
//@ gdb-command:print my_ref__my_field1
|
|
//@ gdb-check:$1 = 11
|
|
//@ gdb-command:continue
|
|
//@ gdb-command:print my_var__my_field2
|
|
//@ gdb-check:$2 = 22
|
|
//@ gdb-command:continue
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
//@ lldb-command:run
|
|
//@ lldb-command:v my_ref__my_field1
|
|
//@ lldb-check:(unsigned int) my_ref__my_field1 = 11
|
|
//@ lldb-command:continue
|
|
//@ lldb-command:v my_var__my_field2
|
|
//@ lldb-check:(unsigned int) my_var__my_field2 = 22
|
|
//@ lldb-command:continue
|
|
|
|
#![allow(unused)]
|
|
|
|
struct MyStruct {
|
|
my_field1: u32,
|
|
my_field2: u32,
|
|
}
|
|
|
|
fn main() {
|
|
let mut my_var = MyStruct { my_field1: 11, my_field2: 22 };
|
|
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() {}
|