1 // Some versions of the non-rust-enabled LLDB print the wrong generic
2 // parameter type names in this test.
7 // === GDB TESTS ===================================================================================
12 // gdb-command:print *self
13 // gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}}
14 // gdbr-check:$1 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
15 // gdb-command:print arg1
17 // gdb-command:print arg2
19 // gdb-command:continue
22 // gdb-command:print self
23 // gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}}
24 // gdbr-check:$4 = method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
25 // gdb-command:print arg1
27 // gdb-command:print arg2
29 // gdb-command:continue
32 // gdb-command:print *self
33 // gdbg-check:$7 = {x = 1234.5}
34 // gdbr-check:$7 = method_on_generic_struct::Struct<f64> {x: 1234.5}
35 // gdb-command:print arg1
37 // gdb-command:print arg2
39 // gdb-command:continue
42 // gdb-command:print self
43 // gdbg-check:$10 = {x = 1234.5}
44 // gdbr-check:$10 = method_on_generic_struct::Struct<f64> {x: 1234.5}
45 // gdb-command:print arg1
47 // gdb-command:print arg2
49 // gdb-command:continue
52 // gdb-command:print *self
53 // gdbg-check:$13 = {x = 1234.5}
54 // gdbr-check:$13 = method_on_generic_struct::Struct<f64> {x: 1234.5}
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 // lldbg-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) }
69 // lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { = 8888 = -8888 } }
70 // lldb-command:print arg1
71 // lldbg-check:[...]$1 = -1
72 // lldbr-check:(isize) arg1 = -1
73 // lldb-command:print arg2
74 // lldbg-check:[...]$2 = -2
75 // lldbr-check:(isize) arg2 = -2
76 // lldb-command:continue
79 // lldb-command:print self
80 // lldbg-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) }
81 // lldbr-check:(method_on_generic_struct::Struct<(u32, i32)>) self = { x = { = 8888 = -8888 } }
82 // lldb-command:print arg1
83 // lldbg-check:[...]$4 = -3
84 // lldbr-check:(isize) arg1 = -3
85 // lldb-command:print arg2
86 // lldbg-check:[...]$5 = -4
87 // lldbr-check:(isize) arg2 = -4
88 // lldb-command:continue
91 // lldb-command:print *self
92 // lldbg-check:[...]$6 = Struct<f64> { x: 1234.5 }
93 // lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 }
94 // lldb-command:print arg1
95 // lldbg-check:[...]$7 = -5
96 // lldbr-check:(isize) arg1 = -5
97 // lldb-command:print arg2
98 // lldbg-check:[...]$8 = -6
99 // lldbr-check:(isize) arg2 = -6
100 // lldb-command:continue
103 // lldb-command:print self
104 // lldbg-check:[...]$9 = Struct<f64> { x: 1234.5 }
105 // lldbr-check:(method_on_generic_struct::Struct<f64>) self = Struct<f64> { x: 1234.5 }
106 // lldb-command:print arg1
107 // lldbg-check:[...]$10 = -7
108 // lldbr-check:(isize) arg1 = -7
109 // lldb-command:print arg2
110 // lldbg-check:[...]$11 = -8
111 // lldbr-check:(isize) arg2 = -8
112 // lldb-command:continue
115 // lldb-command:print *self
116 // lldbg-check:[...]$12 = Struct<f64> { x: 1234.5 }
117 // lldbr-check:(method_on_generic_struct::Struct<f64>) *self = Struct<f64> { x: 1234.5 }
118 // lldb-command:print arg1
119 // lldbg-check:[...]$13 = -9
120 // lldbr-check:(isize) arg1 = -9
121 // lldb-command:print arg2
122 // lldbg-check:[...]$14 = -10
123 // lldbr-check:(isize) arg2 = -10
124 // lldb-command:continue
126 #![feature(omit_gdb_pretty_printer_section)]
127 #![omit_gdb_pretty_printer_section]
129 #[derive(Copy, Clone)]
136 fn self_by_ref(&self, arg1: isize, arg2: isize) -> isize {
141 fn self_by_val(self, arg1: isize, arg2: isize) -> isize {
146 fn self_owned(self: Box<Struct<T>>, arg1: isize, arg2: isize) -> isize {
153 let stack = Struct { x: (8888_u32, -8888_i32) };
154 let _ = stack.self_by_ref(-1, -2);
155 let _ = stack.self_by_val(-3, -4);
157 let owned: Box<_> = Box::new(Struct { x: 1234.5f64 });
158 let _ = owned.self_by_ref(-5, -6);
159 let _ = owned.self_by_val(-7, -8);
160 let _ = owned.self_owned(-9, -10);