]>
git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/method-on-trait.rs
5622d17225ba8e5f7db63ed202861fa9a6a091ed
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 // ignore-android: FIXME(#10381)
12 // min-lldb-version: 310
16 // === GDB TESTS ===================================================================================
21 // gdb-command:print *self
22 // gdb-check:$1 = {x = 100}
23 // gdb-command:print arg1
25 // gdb-command:print arg2
27 // gdb-command:continue
30 // gdb-command:print self
31 // gdb-check:$4 = {x = 100}
32 // gdb-command:print arg1
34 // gdb-command:print arg2
36 // gdb-command:continue
39 // gdb-command:print *self
40 // gdb-check:$7 = {x = 200}
41 // gdb-command:print arg1
43 // gdb-command:print arg2
45 // gdb-command:continue
48 // gdb-command:print self
49 // gdb-check:$10 = {x = 200}
50 // gdb-command:print arg1
52 // gdb-command:print arg2
54 // gdb-command:continue
57 // gdb-command:print *self
58 // gdb-check:$13 = {x = 200}
59 // gdb-command:print arg1
61 // gdb-command:print arg2
62 // gdb-check:$15 = -10
63 // gdb-command:continue
66 // === LLDB TESTS ==================================================================================
71 // lldb-command:print *self
72 // lldb-check:[...]$0 = Struct { x: 100 }
73 // lldb-command:print arg1
74 // lldb-check:[...]$1 = -1
75 // lldb-command:print arg2
76 // lldb-check:[...]$2 = -2
77 // lldb-command:continue
80 // lldb-command:print self
81 // lldb-check:[...]$3 = Struct { x: 100 }
82 // lldb-command:print arg1
83 // lldb-check:[...]$4 = -3
84 // lldb-command:print arg2
85 // lldb-check:[...]$5 = -4
86 // lldb-command:continue
89 // lldb-command:print *self
90 // lldb-check:[...]$6 = Struct { x: 200 }
91 // lldb-command:print arg1
92 // lldb-check:[...]$7 = -5
93 // lldb-command:print arg2
94 // lldb-check:[...]$8 = -6
95 // lldb-command:continue
98 // lldb-command:print self
99 // lldb-check:[...]$9 = Struct { x: 200 }
100 // lldb-command:print arg1
101 // lldb-check:[...]$10 = -7
102 // lldb-command:print arg2
103 // lldb-check:[...]$11 = -8
104 // lldb-command:continue
107 // lldb-command:print *self
108 // lldb-check:[...]$12 = Struct { x: 200 }
109 // lldb-command:print arg1
110 // lldb-check:[...]$13 = -9
111 // lldb-command:print arg2
112 // lldb-check:[...]$14 = -10
113 // lldb-command:continue
116 #![feature(box_syntax)]
117 #![omit_gdb_pretty_printer_section]
124 fn self_by_ref(&self, arg1
: int
, arg2
: int
) -> int
;
125 fn self_by_val(self, arg1
: int
, arg2
: int
) -> int
;
126 fn self_owned(self: Box
<Self>, arg1
: int
, arg2
: int
) -> int
;
129 impl Trait
for Struct
{
131 fn self_by_ref(&self, arg1
: int
, arg2
: int
) -> int
{
136 fn self_by_val(self, arg1
: int
, arg2
: int
) -> int
{
141 fn self_owned(self: Box
<Struct
>, arg1
: int
, arg2
: int
) -> int
{
148 let stack
= Struct { x: 100 }
;
149 let _
= stack
.self_by_ref(-1, -2);
150 let _
= stack
.self_by_val(-3, -4);
152 let owned
= box Struct { x: 200 }
;
153 let _
= owned
.self_by_ref(-5, -6);
154 let _
= owned
.self_by_val(-7, -8);
155 let _
= owned
.self_owned(-9, -10);
160 impl Copy
for Struct {}