1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // min-lldb-version: 310
15 // === GDB TESTS ===================================================================================
20 // gdb-command:print *self
21 // gdb-check:$1 = {x = {__0 = 8888, __1 = -8888}}
22 // gdb-command:print arg1
24 // gdb-command:print arg2
26 // gdb-command:continue
29 // gdb-command:print self
30 // gdb-check:$4 = {x = {__0 = 8888, __1 = -8888}}
31 // gdb-command:print arg1
33 // gdb-command:print arg2
35 // gdb-command:continue
38 // gdb-command:print *self
39 // gdb-check:$7 = {x = 1234.5}
40 // gdb-command:print arg1
42 // gdb-command:print arg2
44 // gdb-command:continue
47 // gdb-command:print self
48 // gdb-check:$10 = {x = 1234.5}
49 // gdb-command:print arg1
51 // gdb-command:print arg2
53 // gdb-command:continue
56 // gdb-command:print *self
57 // gdb-check:$13 = {x = 1234.5}
58 // gdb-command:print arg1
60 // gdb-command:print arg2
61 // gdb-check:$15 = -10
62 // gdb-command:continue
65 // === LLDB TESTS ==================================================================================
70 // lldb-command:print *self
71 // lldb-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) }
72 // lldb-command:print arg1
73 // lldb-check:[...]$1 = -1
74 // lldb-command:print arg2
75 // lldb-check:[...]$2 = -2
76 // lldb-command:continue
79 // lldb-command:print self
80 // lldb-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) }
81 // lldb-command:print arg1
82 // lldb-check:[...]$4 = -3
83 // lldb-command:print arg2
84 // lldb-check:[...]$5 = -4
85 // lldb-command:continue
88 // lldb-command:print *self
89 // lldb-check:[...]$6 = Struct<f64> { x: 1234.5 }
90 // lldb-command:print arg1
91 // lldb-check:[...]$7 = -5
92 // lldb-command:print arg2
93 // lldb-check:[...]$8 = -6
94 // lldb-command:continue
97 // lldb-command:print self
98 // lldb-check:[...]$9 = Struct<f64> { x: 1234.5 }
99 // lldb-command:print arg1
100 // lldb-check:[...]$10 = -7
101 // lldb-command:print arg2
102 // lldb-check:[...]$11 = -8
103 // lldb-command:continue
106 // lldb-command:print *self
107 // lldb-check:[...]$12 = Struct<f64> { x: 1234.5 }
108 // lldb-command:print arg1
109 // lldb-check:[...]$13 = -9
110 // lldb-command:print arg2
111 // lldb-check:[...]$14 = -10
112 // lldb-command:continue
115 #![feature(box_syntax)]
116 #![feature(omit_gdb_pretty_printer_section)]
117 #![omit_gdb_pretty_printer_section]
119 #[derive(Copy, Clone)]
126 fn self_by_ref(&self, arg1
: isize, arg2
: isize) -> isize {
131 fn self_by_val(self, arg1
: isize, arg2
: isize) -> isize {
136 fn self_owned(self: Box
<Struct
<T
>>, arg1
: isize, arg2
: isize) -> isize {
143 let stack
= Struct { x: (8888_u32, -8888_i32) }
;
144 let _
= stack
.self_by_ref(-1, -2);
145 let _
= stack
.self_by_val(-3, -4);
147 let owned
: Box
<_
> = box Struct { x: 1234.5f64 }
;
148 let _
= owned
.self_by_ref(-5, -6);
149 let _
= owned
.self_by_val(-7, -8);
150 let _
= owned
.self_owned(-9, -10);