1 // min-lldb-version: 310
2 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
6 // === GDB TESTS ===================================================================================
11 // gdb-command:print *self
12 // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
13 // gdbr-check:$1 = method_on_enum::Enum::Variant2(117901063)
14 // gdb-command:print arg1
16 // gdb-command:print arg2
18 // gdb-command:continue
21 // gdb-command:print self
22 // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
23 // gdbr-check:$4 = method_on_enum::Enum::Variant2(117901063)
24 // gdb-command:print arg1
26 // gdb-command:print arg2
28 // gdb-command:continue
31 // gdb-command:print *self
32 // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
33 // gdbr-check:$7 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
34 // gdb-command:print arg1
36 // gdb-command:print arg2
38 // gdb-command:continue
41 // gdb-command:print self
42 // gdbg-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
43 // gdbr-check:$10 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
44 // gdb-command:print arg1
46 // gdb-command:print arg2
48 // gdb-command:continue
51 // gdb-command:print *self
52 // gdbg-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
53 // gdbr-check:$13 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
54 // gdb-command:print arg1
56 // gdb-command:print arg2
57 // gdb-check:$15 = -10
58 // gdb-command:continue
61 // === LLDB TESTS ==================================================================================
66 // lldb-command:print *self
67 // lldb-check:[...]$0 = Variant2(117901063)
68 // lldb-command:print arg1
69 // lldb-check:[...]$1 = -1
70 // lldb-command:print arg2
71 // lldb-check:[...]$2 = -2
72 // lldb-command:continue
75 // lldb-command:print self
76 // lldb-check:[...]$3 = Variant2(117901063)
77 // lldb-command:print arg1
78 // lldb-check:[...]$4 = -3
79 // lldb-command:print arg2
80 // lldb-check:[...]$5 = -4
81 // lldb-command:continue
84 // lldb-command:print *self
85 // lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 }
86 // lldb-command:print arg1
87 // lldb-check:[...]$7 = -5
88 // lldb-command:print arg2
89 // lldb-check:[...]$8 = -6
90 // lldb-command:continue
93 // lldb-command:print self
94 // lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 }
95 // lldb-command:print arg1
96 // lldb-check:[...]$10 = -7
97 // lldb-command:print arg2
98 // lldb-check:[...]$11 = -8
99 // lldb-command:continue
102 // lldb-command:print *self
103 // lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 }
104 // lldb-command:print arg1
105 // lldb-check:[...]$13 = -9
106 // lldb-command:print arg2
107 // lldb-check:[...]$14 = -10
108 // lldb-command:continue
110 #![feature(omit_gdb_pretty_printer_section)]
111 #![omit_gdb_pretty_printer_section]
113 #[derive(Copy, Clone)]
115 Variant1 { x: u16, y: u16 },
121 fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize {
126 fn self_by_val(self, arg1: isize, arg2: isize) -> isize {
131 fn self_owned(self: Box<Enum>, arg1: isize, arg2: isize) -> isize {
138 let stack = Enum::Variant2(117901063);
139 let _ = stack.self_by_ref(-1, -2);
140 let _ = stack.self_by_val(-3, -4);
142 let owned: Box<_> = Box::new(Enum::Variant1{ x: 1799, y: 1799 });
143 let _ = owned.self_by_ref(-5, -6);
144 let _ = owned.self_by_val(-7, -8);
145 let _ = owned.self_owned(-9, -10);