]> git.lizzy.rs Git - rust.git/blob - src/test/debug-info/method-on-generic-struct.rs
Ignore tests broken by failing on ICE
[rust.git] / src / test / debug-info / method-on-generic-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.
4 //
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.
10
11 // ignore-android: FIXME(#10381)
12
13 // compile-flags:-g
14 // debugger:rbreak zzz
15 // debugger:run
16
17 // STACK BY REF
18 // debugger:finish
19 // debugger:print *self
20 // check:$1 = {x = {8888, -8888}}
21 // debugger:print arg1
22 // check:$2 = -1
23 // debugger:print arg2
24 // check:$3 = -2
25 // debugger:continue
26
27 // STACK BY VAL
28 // debugger:finish
29 // debugger:print self
30 // check:$4 = {x = {8888, -8888}}
31 // debugger:print arg1
32 // check:$5 = -3
33 // debugger:print arg2
34 // check:$6 = -4
35 // debugger:continue
36
37 // OWNED BY REF
38 // debugger:finish
39 // debugger:print *self
40 // check:$7 = {x = 1234.5}
41 // debugger:print arg1
42 // check:$8 = -5
43 // debugger:print arg2
44 // check:$9 = -6
45 // debugger:continue
46
47 // OWNED BY VAL
48 // debugger:finish
49 // debugger:print self
50 // check:$10 = {x = 1234.5}
51 // debugger:print arg1
52 // check:$11 = -7
53 // debugger:print arg2
54 // check:$12 = -8
55 // debugger:continue
56
57 // OWNED MOVED
58 // debugger:finish
59 // debugger:print *self
60 // check:$13 = {x = 1234.5}
61 // debugger:print arg1
62 // check:$14 = -9
63 // debugger:print arg2
64 // check:$15 = -10
65 // debugger:continue
66
67 struct Struct<T> {
68     x: T
69 }
70
71 impl<T> Struct<T> {
72
73     fn self_by_ref(&self, arg1: int, arg2: int) -> int {
74         zzz();
75         arg1 + arg2
76     }
77
78     fn self_by_val(self, arg1: int, arg2: int) -> int {
79         zzz();
80         arg1 + arg2
81     }
82
83     fn self_owned(~self, arg1: int, arg2: int) -> int {
84         zzz();
85         arg1 + arg2
86     }
87 }
88
89 fn main() {
90     let stack = Struct { x: (8888_u32, -8888_i32) };
91     let _ = stack.self_by_ref(-1, -2);
92     let _ = stack.self_by_val(-3, -4);
93
94     let owned = ~Struct { x: 1234.5 };
95     let _ = owned.self_by_ref(-5, -6);
96     let _ = owned.self_by_val(-7, -8);
97     let _ = owned.self_owned(-9, -10);
98 }
99
100 fn zzz() {()}