]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/gdb-pretty-struct-and-enums.rs
Auto merge of #82552 - GuillaumeGomez:rollup-8dn1ztn, r=GuillaumeGomez
[rust.git] / src / test / debuginfo / gdb-pretty-struct-and-enums.rs
1 // ignore-tidy-linelength
2 // ignore-lldb
3 // ignore-android: FIXME(#10381)
4 // min-gdb-version: 8.1
5
6 // compile-flags:-g
7
8 // gdb-command: run
9
10 // gdb-command: print regular_struct
11 // gdbg-check:$1 = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
12 // gdbr-check:$1 = gdb_pretty_struct_and_enums::RegularStruct {the_first_field: 101, the_second_field: 102.5, the_third_field: false}
13
14 // gdb-command: print empty_struct
15 // gdbg-check:$2 = EmptyStruct
16 // gdbr-check:$2 = gdb_pretty_struct_and_enums::EmptyStruct
17
18 // gdb-command: print c_style_enum1
19 // gdbg-check:$3 = CStyleEnumVar1
20 // gdbr-check:$3 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar1
21
22 // gdb-command: print c_style_enum2
23 // gdbg-check:$4 = CStyleEnumVar2
24 // gdbr-check:$4 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar2
25
26 // gdb-command: print c_style_enum3
27 // gdbg-check:$5 = CStyleEnumVar3
28 // gdbr-check:$5 = gdb_pretty_struct_and_enums::CStyleEnum::CStyleEnumVar3
29
30 #![allow(dead_code, unused_variables)]
31
32 struct RegularStruct {
33     the_first_field: isize,
34     the_second_field: f64,
35     the_third_field: bool,
36 }
37
38 struct EmptyStruct;
39
40 enum CStyleEnum {
41     CStyleEnumVar1,
42     CStyleEnumVar2,
43     CStyleEnumVar3,
44 }
45
46 fn main() {
47
48     let regular_struct = RegularStruct {
49         the_first_field: 101,
50         the_second_field: 102.5,
51         the_third_field: false
52     };
53
54     let empty_struct = EmptyStruct;
55
56     let c_style_enum1 = CStyleEnum::CStyleEnumVar1;
57     let c_style_enum2 = CStyleEnum::CStyleEnumVar2;
58     let c_style_enum3 = CStyleEnum::CStyleEnumVar3;
59
60     zzz(); // #break
61 }
62
63 fn zzz() { () }