1 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
2 // min-lldb-version: 310
6 // === GDB TESTS ===================================================================================
10 // gdb-command:print s
11 // gdbg-check:$1 = {a = 1, b = 2.5}
12 // gdbr-check:$1 = by_value_non_immediate_argument::Struct {a: 1, b: 2.5}
13 // gdb-command:continue
15 // gdb-command:print x
16 // gdbg-check:$2 = {a = 3, b = 4.5}
17 // gdbr-check:$2 = by_value_non_immediate_argument::Struct {a: 3, b: 4.5}
18 // gdb-command:print y
20 // gdb-command:print z
22 // gdb-command:continue
24 // gdb-command:print a
25 // gdbg-check:$5 = {__0 = 7, __1 = 8, __2 = 9.5, __3 = 10.5}
26 // gdbr-check:$5 = (7, 8, 9.5, 10.5)
27 // gdb-command:continue
29 // gdb-command:print a
30 // gdbg-check:$6 = {__0 = 11.5, __1 = 12.5, __2 = 13, __3 = 14}
31 // gdbr-check:$6 = by_value_non_immediate_argument::Newtype (11.5, 12.5, 13, 14)
32 // gdb-command:continue
34 // gdb-command:print x
35 // gdbg-check:$7 = {{RUST$ENUM$DISR = Case1, x = 0, y = 8970181431921507452}, {RUST$ENUM$DISR = Case1, [...]}}
36 // gdbr-check:$7 = by_value_non_immediate_argument::Enum::Case1{x: 0, y: 8970181431921507452}
37 // gdb-command:continue
40 // === LLDB TESTS ==================================================================================
44 // lldb-command:print s
45 // lldb-check:[...]$0 = Struct { a: 1, b: 2.5 }
46 // lldb-command:continue
48 // lldb-command:print x
49 // lldb-check:[...]$1 = Struct { a: 3, b: 4.5 }
50 // lldb-command:print y
51 // lldb-check:[...]$2 = 5
52 // lldb-command:print z
53 // lldb-check:[...]$3 = 6.5
54 // lldb-command:continue
56 // lldb-command:print a
57 // lldb-check:[...]$4 = (7, 8, 9.5, 10.5)
58 // lldb-command:continue
60 // lldb-command:print a
61 // lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14)
62 // lldb-command:continue
64 // lldb-command:print x
65 // lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 }
66 // lldb-command:continue
68 #![feature(omit_gdb_pretty_printer_section)]
69 #![omit_gdb_pretty_printer_section]
87 fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) {
91 fn tup(a: (isize, usize, f64, f64)) {
95 struct Newtype(f64, f64, isize, usize);
97 fn new_type(a: Newtype) {
101 // The first element is to ensure proper alignment, irrespective of the machines word size. Since
102 // the size of the discriminant value is machine dependent, this has be taken into account when
103 // datatype layout should be predictable as in this case.
105 Case1 { x: i64, y: i64 },
106 Case2 (i64, i32, i32),
109 fn by_val_enum(x: Enum) {
114 fun(Struct { a: 1, b: 2.5 });
115 fun_fun(StructStruct { a: Struct { a: 3, b: 4.5 }, b: Struct { a: 5, b: 6.5 } });
116 tup((7, 8, 9.5, 10.5));
117 new_type(Newtype(11.5, 12.5, 13, 14));
119 // 0b0111110001111100011111000111110001111100011111000111110001111100 = 8970181431921507452
120 // 0b01111100011111000111110001111100 = 2088533116
121 // 0b0111110001111100 = 31868
123 by_val_enum(Enum::Case1 { x: 0, y: 8970181431921507452 });