1 // ignore-tidy-linelength
5 // Some versions of the non-rust-enabled LLDB print the wrong generic
6 // parameter type names in this test.
9 // === GDB TESTS ===================================================================================
14 // gdb-command:print *self
15 // gdbg-check:$1 = {x = {__0 = 8888, __1 = -8888}}
16 // gdbr-check:$1 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
17 // gdb-command:print arg1
19 // gdb-command:print arg2
21 // gdb-command:continue
24 // gdb-command:print self
25 // gdbg-check:$4 = {x = {__0 = 8888, __1 = -8888}}
26 // gdbr-check:$4 = generic_method_on_generic_struct::Struct<(u32, i32)> {x: (8888, -8888)}
27 // gdb-command:print arg1
29 // gdb-command:print arg2
31 // gdb-command:continue
34 // gdb-command:print *self
35 // gdbg-check:$7 = {x = 1234.5}
36 // gdbr-check:$7 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
37 // gdb-command:print arg1
39 // gdb-command:print arg2
41 // gdb-command:continue
44 // gdb-command:print self
45 // gdbg-check:$10 = {x = 1234.5}
46 // gdbr-check:$10 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
47 // gdb-command:print arg1
49 // gdb-command:print arg2
51 // gdb-command:continue
54 // gdb-command:print *self
55 // gdbg-check:$13 = {x = 1234.5}
56 // gdbr-check:$13 = generic_method_on_generic_struct::Struct<f64> {x: 1234.5}
57 // gdb-command:print arg1
59 // gdb-command:print arg2
60 // gdb-check:$15 = -10.5
61 // gdb-command:continue
64 // === LLDB TESTS ==================================================================================
69 // lldb-command:print *self
70 // lldbg-check:[...]$0 = { x = { 0 = 8888, 1 = -8888 } }
71 // lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) *self = { x = { 0 = 8888 1 = -8888 } }
72 // lldb-command:print arg1
73 // lldbg-check:[...]$1 = -1
74 // lldbr-check:(isize) arg1 = -1
75 // lldb-command:print arg2
76 // lldbg-check:[...]$2 = 2
77 // lldbr-check:(u16) arg2 = 2
78 // lldb-command:continue
81 // lldb-command:print self
82 // lldbg-check:[...]$3 = { x = { 0 = 8888, 1 = -8888 } }
83 // lldbr-check:(generic_method_on_generic_struct::Struct<(u32, i32)>) self = { x = { 0 = 8888, 1 = -8888 } }
84 // lldb-command:print arg1
85 // lldbg-check:[...]$4 = -3
86 // lldbr-check:(isize) arg1 = -3
87 // lldb-command:print arg2
88 // lldbg-check:[...]$5 = -4
89 // lldbr-check:(i16) arg2 = -4
90 // lldb-command:continue
93 // lldb-command:print *self
94 // lldbg-check:[...]$6 = { x = 1234.5 }
95 // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 }
96 // lldb-command:print arg1
97 // lldbg-check:[...]$7 = -5
98 // lldbr-check:(isize) arg1 = -5
99 // lldb-command:print arg2
100 // lldbg-check:[...]$8 = -6
101 // lldbr-check:(i32) arg2 = -6
102 // lldb-command:continue
105 // lldb-command:print self
106 // lldbg-check:[...]$9 = { x = 1234.5 }
107 // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) self = { x = 1234.5 }
108 // lldb-command:print arg1
109 // lldbg-check:[...]$10 = -7
110 // lldbr-check:(isize) arg1 = -7
111 // lldb-command:print arg2
112 // lldbg-check:[...]$11 = -8
113 // lldbr-check:(i64) arg2 = -8
114 // lldb-command:continue
117 // lldb-command:print *self
118 // lldbg-check:[...]$12 = { x = 1234.5 }
119 // lldbr-check:(generic_method_on_generic_struct::Struct<f64>) *self = { x = 1234.5 }
120 // lldb-command:print arg1
121 // lldbg-check:[...]$13 = -9
122 // lldbr-check:(isize) arg1 = -9
123 // lldb-command:print arg2
124 // lldbg-check:[...]$14 = -10.5
125 // lldbr-check:(f32) arg2 = -10.5
126 // lldb-command:continue
128 #![feature(box_syntax)]
129 #![feature(omit_gdb_pretty_printer_section)]
130 #![omit_gdb_pretty_printer_section]
132 #[derive(Copy, Clone)]
137 impl<T1
> Struct
<T1
> {
139 fn self_by_ref
<T2
>(&self, arg1
: isize, arg2
: T2
) -> isize {
144 fn self_by_val
<T2
>(self, arg1
: isize, arg2
: T2
) -> isize {
149 fn self_owned
<T2
>(self: Box
<Struct
<T1
>>, arg1
: isize, arg2
: T2
) -> isize {
156 let stack
= Struct { x: (8888_u32, -8888_i32) }
;
157 let _
= stack
.self_by_ref(-1, 2_u16);
158 let _
= stack
.self_by_val(-3, -4_i16);
160 let owned
: Box
<_
> = box Struct { x: 1234.5f64 }
;
161 let _
= owned
.self_by_ref(-5, -6_i32);
162 let _
= owned
.self_by_val(-7, -8_i64);
163 let _
= owned
.self_owned(-9, -10.5_f32);