1 // ignore-tidy-linelength
2 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
3 // min-lldb-version: 310
7 // === GDB TESTS ===================================================================================
11 // gdb-command:print s
12 // gdbg-check:$1 = {a = 1, b = 2.5}
13 // gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
14 // gdb-command:continue
16 // gdb-command:print x
17 // gdbg-check:$2 = {a = 3, b = 4.5}
18 // gdbr-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5}
19 // gdb-command:print y
21 // gdb-command:print z
23 // gdb-command:continue
25 // gdb-command:print a
26 // gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
27 // gdbr-check:$5 = (7, 8, 9.5, 10.5)
28 // gdb-command:continue
30 // gdb-command:print a
31 // gdbg-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14}
32 // gdbr-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14)
33 // gdb-command:continue
35 // gdb-command:print x
36 // gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, [...]}}
37 // gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
38 // gdb-command:continue
41 // === LLDB TESTS ==================================================================================
45 // lldb-command:print s
46 // lldb-check:[...]$0 = Struct { a: 1, b: 2.5 }
47 // lldb-command:continue
49 // lldb-command:print x
50 // lldb-check:[...]$1 = Struct { a: 3, b: 4.5 }
51 // lldb-command:print y
52 // lldb-check:[...]$2 = 5
53 // lldb-command:print z
54 // lldb-check:[...]$3 = 6.5
55 // lldb-command:continue
57 // lldb-command:print a
58 // lldb-check:[...]$4 = (7, 8, 9.5, 10.5)
59 // lldb-command:continue
61 // lldb-command:print a
62 // lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14)
63 // lldb-command:continue
65 // lldb-command:print x
66 // lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 }
67 // lldb-command:continue
69 #![feature(omit_gdb_pretty_printer_section)]
70 #![omit_gdb_pretty_printer_section]
88 fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) {
92 fn tup(a: (isize, usize, f64, f64)) {
96 struct Newtype(f64, f64, isize, usize);
98 fn new_type(a: Newtype) {
102 // The first element is to ensure proper alignment, irrespective of the machines word size. Since
103 // the size of the discriminant value is machine dependent, this has be taken into account when
104 // datatype layout should be predictable as in this case.
106 Case1 { x: i64, y: i64 },
107 Case2 (i64, i32, i32),
110 fn by_val_enum(x: Enum) {
115 fun(Struct { a: 1, b: 2.5 });
116 fun_fun(StructStruct { a: Struct { a: 3, b: 4.5 }, b: Struct { a: 5, b: 6.5 } });
117 tup((7, 8, 9.5, 10.5));
118 new_type(Newtype(11.5, 12.5, 13, 14));
120 // 0b0111110001111100011111000111110001111100011111000111110001111100 = 8970181431921507452
121 // 0b01111100011111000111110001111100 = 2088533116
122 // 0b0111110001111100 = 31868
124 by_val_enum(Enum::Case1 { x: 0, y: 8970181431921507452 });