1 // ignore-tidy-linelength
2 // min-lldb-version: 310
3 // ignore-test // Test temporarily ignored due to debuginfo tests being disabled, see PR 47155
7 // === GDB TESTS ===================================================================================
12 // gdb-command:print *self
13 // gdbg-check:$1 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
14 // gdbr-check:$1 = method_on_enum::Enum::Variant2(117901063)
15 // gdb-command:print arg1
17 // gdb-command:print arg2
19 // gdb-command:continue
22 // gdb-command:print self
23 // gdbg-check:$4 = {{RUST$ENUM$DISR = Variant2, [...]}, {RUST$ENUM$DISR = Variant2, __0 = 117901063}}
24 // gdbr-check:$4 = method_on_enum::Enum::Variant2(117901063)
25 // gdb-command:print arg1
27 // gdb-command:print arg2
29 // gdb-command:continue
32 // gdb-command:print *self
33 // gdbg-check:$7 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
34 // gdbr-check:$7 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
35 // gdb-command:print arg1
37 // gdb-command:print arg2
39 // gdb-command:continue
42 // gdb-command:print self
43 // gdbg-check:$10 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
44 // gdbr-check:$10 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
45 // gdb-command:print arg1
47 // gdb-command:print arg2
49 // gdb-command:continue
52 // gdb-command:print *self
53 // gdbg-check:$13 = {{RUST$ENUM$DISR = Variant1, x = 1799, y = 1799}, {RUST$ENUM$DISR = Variant1, [...]}}
54 // gdbr-check:$13 = method_on_enum::Enum::Variant1{x: 1799, y: 1799}
55 // gdb-command:print arg1
57 // gdb-command:print arg2
58 // gdb-check:$15 = -10
59 // gdb-command:continue
62 // === LLDB TESTS ==================================================================================
67 // lldb-command:print *self
68 // lldb-check:[...]$0 = Variant2(117901063)
69 // lldb-command:print arg1
70 // lldb-check:[...]$1 = -1
71 // lldb-command:print arg2
72 // lldb-check:[...]$2 = -2
73 // lldb-command:continue
76 // lldb-command:print self
77 // lldb-check:[...]$3 = Variant2(117901063)
78 // lldb-command:print arg1
79 // lldb-check:[...]$4 = -3
80 // lldb-command:print arg2
81 // lldb-check:[...]$5 = -4
82 // lldb-command:continue
85 // lldb-command:print *self
86 // lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 }
87 // lldb-command:print arg1
88 // lldb-check:[...]$7 = -5
89 // lldb-command:print arg2
90 // lldb-check:[...]$8 = -6
91 // lldb-command:continue
94 // lldb-command:print self
95 // lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 }
96 // lldb-command:print arg1
97 // lldb-check:[...]$10 = -7
98 // lldb-command:print arg2
99 // lldb-check:[...]$11 = -8
100 // lldb-command:continue
103 // lldb-command:print *self
104 // lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 }
105 // lldb-command:print arg1
106 // lldb-check:[...]$13 = -9
107 // lldb-command:print arg2
108 // lldb-check:[...]$14 = -10
109 // lldb-command:continue
111 #![feature(box_syntax)]
112 #![feature(omit_gdb_pretty_printer_section)]
113 #![omit_gdb_pretty_printer_section]
115 #[derive(Copy, Clone)]
117 Variant1 { x: u16, y: u16 },
123 fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize {
128 fn self_by_val(self, arg1: isize, arg2: isize) -> isize {
133 fn self_owned(self: Box<Enum>, arg1: isize, arg2: isize) -> isize {
140 let stack = Enum::Variant2(117901063);
141 let _ = stack.self_by_ref(-1, -2);
142 let _ = stack.self_by_val(-3, -4);
144 let owned: Box<_> = box Enum::Variant1{ x: 1799, y: 1799 };
145 let _ = owned.self_by_ref(-5, -6);
146 let _ = owned.self_by_val(-7, -8);
147 let _ = owned.self_owned(-9, -10);