]>
git.proxmox.com Git - rustc.git/blob - src/test/debuginfo/method-on-tuple-struct.rs
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 // gdbg-check:$1 = {__0 = 100, __1 = -100.5}
22 // gdbr-check:$1 = method_on_tuple_struct::TupleStruct (100, -100.5)
23 // gdb-command:print arg1
25 // gdb-command:print arg2
27 // gdb-command:continue
30 // gdb-command:print self
31 // gdbg-check:$4 = {__0 = 100, __1 = -100.5}
32 // gdbr-check:$4 = method_on_tuple_struct::TupleStruct (100, -100.5)
33 // gdb-command:print arg1
35 // gdb-command:print arg2
37 // gdb-command:continue
40 // gdb-command:print *self
41 // gdbg-check:$7 = {__0 = 200, __1 = -200.5}
42 // gdbr-check:$7 = method_on_tuple_struct::TupleStruct (200, -200.5)
43 // gdb-command:print arg1
45 // gdb-command:print arg2
47 // gdb-command:continue
50 // gdb-command:print self
51 // gdbg-check:$10 = {__0 = 200, __1 = -200.5}
52 // gdbr-check:$10 = method_on_tuple_struct::TupleStruct (200, -200.5)
53 // gdb-command:print arg1
55 // gdb-command:print arg2
57 // gdb-command:continue
60 // gdb-command:print *self
61 // gdbg-check:$13 = {__0 = 200, __1 = -200.5}
62 // gdbr-check:$13 = method_on_tuple_struct::TupleStruct (200, -200.5)
63 // gdb-command:print arg1
65 // gdb-command:print arg2
66 // gdb-check:$15 = -10
67 // gdb-command:continue
70 // === LLDB TESTS ==================================================================================
75 // lldb-command:print *self
76 // lldb-check:[...]$0 = TupleStruct(100, -100.5)
77 // lldb-command:print arg1
78 // lldb-check:[...]$1 = -1
79 // lldb-command:print arg2
80 // lldb-check:[...]$2 = -2
81 // lldb-command:continue
84 // lldb-command:print self
85 // lldb-check:[...]$3 = TupleStruct(100, -100.5)
86 // lldb-command:print arg1
87 // lldb-check:[...]$4 = -3
88 // lldb-command:print arg2
89 // lldb-check:[...]$5 = -4
90 // lldb-command:continue
93 // lldb-command:print *self
94 // lldb-check:[...]$6 = TupleStruct(200, -200.5)
95 // lldb-command:print arg1
96 // lldb-check:[...]$7 = -5
97 // lldb-command:print arg2
98 // lldb-check:[...]$8 = -6
99 // lldb-command:continue
102 // lldb-command:print self
103 // lldb-check:[...]$9 = TupleStruct(200, -200.5)
104 // lldb-command:print arg1
105 // lldb-check:[...]$10 = -7
106 // lldb-command:print arg2
107 // lldb-check:[...]$11 = -8
108 // lldb-command:continue
111 // lldb-command:print *self
112 // lldb-check:[...]$12 = TupleStruct(200, -200.5)
113 // lldb-command:print arg1
114 // lldb-check:[...]$13 = -9
115 // lldb-command:print arg2
116 // lldb-check:[...]$14 = -10
117 // lldb-command:continue
120 #![feature(box_syntax)]
121 #![feature(omit_gdb_pretty_printer_section)]
122 #![omit_gdb_pretty_printer_section]
124 #[derive(Copy, Clone)]
125 struct TupleStruct(isize, f64);
129 fn self_by_ref(&self, arg1
: isize, arg2
: isize) -> isize {
134 fn self_by_val(self, arg1
: isize, arg2
: isize) -> isize {
139 fn self_owned(self: Box
<TupleStruct
>, arg1
: isize, arg2
: isize) -> isize {
146 let stack
= TupleStruct(100, -100.5);
147 let _
= stack
.self_by_ref(-1, -2);
148 let _
= stack
.self_by_val(-3, -4);
150 let owned
: Box
<_
> = box TupleStruct(200, -200.5);
151 let _
= owned
.self_by_ref(-5, -6);
152 let _
= owned
.self_by_val(-7, -8);
153 let _
= owned
.self_owned(-9, -10);