Skip to content

Commit 9e876d3

Browse files
---
yaml --- r: 144046 b: refs/heads/try2 c: a36e537 h: refs/heads/master v: v3
1 parent 07e87e2 commit 9e876d3

File tree

7 files changed

+664
-1
lines changed

7 files changed

+664
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 689929c51a7eb4458458b53b92f2c775b444b405
8+
refs/heads/try2: a36e53730f616479596868ba67fd1932064a00ea
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2013 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+
// Does not work yet, see issue #8512
12+
// xfail-test
13+
14+
// compile-flags:-Z extra-debug-info
15+
// debugger:break zzz
16+
// debugger:run
17+
18+
// debugger:finish
19+
// debugger:print s
20+
// check:$1 = {a = 1, b = 2.5}
21+
// debugger:continue
22+
23+
#[deriving(Clone)]
24+
struct Struct {
25+
a: int,
26+
b: float
27+
}
28+
29+
fn fun(s: Struct) {
30+
zzz();
31+
}
32+
33+
fn main() {
34+
fun(Struct { a: 1, b: 2.5 });
35+
}
36+
37+
fn zzz() {()}
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
// Copyright 2013 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+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:break zzz
15+
// debugger:run
16+
17+
// STACK BY REF
18+
// debugger:finish
19+
// debugger:print *self
20+
// check:$1 = {{Variant2, x = 1799, y = 1799}, {Variant2, 117901063}}
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+
// d ebugger:print self -- ignored for now because of issue #8512
30+
// c heck:$X = {{Variant2, x = 1799, y = 1799}, {Variant2, 117901063}}
31+
// debugger:print arg1
32+
// check:$4 = -3
33+
// debugger:print arg2
34+
// check:$5 = -4
35+
// debugger:continue
36+
37+
// OWNED BY REF
38+
// debugger:finish
39+
// debugger:print *self
40+
// check:$6 = {{Variant1, x = 1799, y = 1799}, {Variant1, 117901063}}
41+
// debugger:print arg1
42+
// check:$7 = -5
43+
// debugger:print arg2
44+
// check:$8 = -6
45+
// debugger:continue
46+
47+
// OWNED BY VAL
48+
// debugger:finish
49+
// d ebugger:print self -- ignored for now because of issue #8512
50+
// c heck:$X = {{Variant1, x = 1799, y = 1799}, {Variant1, 117901063}}
51+
// debugger:print arg1
52+
// check:$9 = -7
53+
// debugger:print arg2
54+
// check:$10 = -8
55+
// debugger:continue
56+
57+
// OWNED MOVED
58+
// debugger:finish
59+
// debugger:print *self
60+
// check:$11 = {{Variant1, x = 1799, y = 1799}, {Variant1, 117901063}}
61+
// debugger:print arg1
62+
// check:$12 = -9
63+
// debugger:print arg2
64+
// check:$13 = -10
65+
// debugger:continue
66+
67+
// MANAGED BY REF
68+
// debugger:finish
69+
// debugger:print *self
70+
// check:$14 = {{Variant2, x = 1799, y = 1799}, {Variant2, 117901063}}
71+
// debugger:print arg1
72+
// check:$15 = -11
73+
// debugger:print arg2
74+
// check:$16 = -12
75+
// debugger:continue
76+
77+
// MANAGED BY VAL
78+
// debugger:finish
79+
// d ebugger:print self -- ignored for now because of issue #8512
80+
// c heck:$X = {{Variant2, x = 1799, y = 1799}, {Variant2, 117901063}}
81+
// debugger:print arg1
82+
// check:$17 = -13
83+
// debugger:print arg2
84+
// check:$18 = -14
85+
// debugger:continue
86+
87+
// MANAGED SELF
88+
// debugger:finish
89+
// debugger:print self->val
90+
// check:$19 = {{Variant2, x = 1799, y = 1799}, {Variant2, 117901063}}
91+
// debugger:print arg1
92+
// check:$20 = -15
93+
// debugger:print arg2
94+
// check:$21 = -16
95+
// debugger:continue
96+
97+
enum Enum {
98+
Variant1 { x: u16, y: u16 },
99+
Variant2 (u32)
100+
}
101+
102+
impl Enum {
103+
104+
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
105+
zzz();
106+
arg1 + arg2
107+
}
108+
109+
fn self_by_val(self, arg1: int, arg2: int) -> int {
110+
zzz();
111+
arg1 + arg2
112+
}
113+
114+
fn self_owned(~self, arg1: int, arg2: int) -> int {
115+
zzz();
116+
arg1 + arg2
117+
}
118+
119+
fn self_managed(@self, arg1: int, arg2: int) -> int {
120+
zzz();
121+
arg1 + arg2
122+
}
123+
}
124+
125+
fn main() {
126+
let stack = Variant2(117901063);
127+
let _ = stack.self_by_ref(-1, -2);
128+
let _ = stack.self_by_val(-3, -4);
129+
130+
let owned = ~Variant1{ x: 1799, y: 1799 };
131+
let _ = owned.self_by_ref(-5, -6);
132+
let _ = owned.self_by_val(-7, -8);
133+
let _ = owned.self_owned(-9, -10);
134+
135+
let managed = @Variant2(117901063);
136+
let _ = managed.self_by_ref(-11, -12);
137+
let _ = managed.self_by_val(-13, -14);
138+
let _ = managed.self_managed(-15, -16);
139+
}
140+
141+
fn zzz() {()}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
// Copyright 2013 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+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:break zzz
15+
// debugger:run
16+
17+
// STACK BY REF
18+
// debugger:finish
19+
// debugger:print *self
20+
// check:$1 = {x = 100}
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+
// d ebugger:print self -- ignored for now because of issue #8512
30+
// c heck:$X = {x = 100}
31+
// debugger:print arg1
32+
// check:$4 = -3
33+
// debugger:print arg2
34+
// check:$5 = -4
35+
// debugger:continue
36+
37+
// OWNED BY REF
38+
// debugger:finish
39+
// debugger:print *self
40+
// check:$6 = {x = 200}
41+
// debugger:print arg1
42+
// check:$7 = -5
43+
// debugger:print arg2
44+
// check:$8 = -6
45+
// debugger:continue
46+
47+
// OWNED BY VAL
48+
// debugger:finish
49+
// d ebugger:print self -- ignored for now because of issue #8512
50+
// c heck:$X = {x = 200}
51+
// debugger:print arg1
52+
// check:$9 = -7
53+
// debugger:print arg2
54+
// check:$10 = -8
55+
// debugger:continue
56+
57+
// OWNED MOVED
58+
// debugger:finish
59+
// debugger:print *self
60+
// check:$11 = {x = 200}
61+
// debugger:print arg1
62+
// check:$12 = -9
63+
// debugger:print arg2
64+
// check:$13 = -10
65+
// debugger:continue
66+
67+
// MANAGED BY REF
68+
// debugger:finish
69+
// debugger:print *self
70+
// check:$14 = {x = 300}
71+
// debugger:print arg1
72+
// check:$15 = -11
73+
// debugger:print arg2
74+
// check:$16 = -12
75+
// debugger:continue
76+
77+
// MANAGED BY VAL
78+
// debugger:finish
79+
// d ebugger:print self -- ignored for now because of issue #8512
80+
// c heck:$X = {x = 300}
81+
// debugger:print arg1
82+
// check:$17 = -13
83+
// debugger:print arg2
84+
// check:$18 = -14
85+
// debugger:continue
86+
87+
// MANAGED SELF
88+
// debugger:finish
89+
// debugger:print self->val
90+
// check:$19 = {x = 300}
91+
// debugger:print arg1
92+
// check:$20 = -15
93+
// debugger:print arg2
94+
// check:$21 = -16
95+
// debugger:continue
96+
97+
struct Struct {
98+
x: int
99+
}
100+
101+
impl Struct {
102+
103+
fn self_by_ref(&self, arg1: int, arg2: int) -> int {
104+
zzz();
105+
self.x + arg1 + arg2
106+
}
107+
108+
fn self_by_val(self, arg1: int, arg2: int) -> int {
109+
zzz();
110+
self.x + arg1 + arg2
111+
}
112+
113+
fn self_owned(~self, arg1: int, arg2: int) -> int {
114+
zzz();
115+
self.x + arg1 + arg2
116+
}
117+
118+
fn self_managed(@self, arg1: int, arg2: int) -> int {
119+
zzz();
120+
self.x + arg1 + arg2
121+
}
122+
}
123+
124+
fn main() {
125+
let stack = Struct { x: 100 };
126+
let _ = stack.self_by_ref(-1, -2);
127+
let _ = stack.self_by_val(-3, -4);
128+
129+
let owned = ~Struct { x: 200 };
130+
let _ = owned.self_by_ref(-5, -6);
131+
let _ = owned.self_by_val(-7, -8);
132+
let _ = owned.self_owned(-9, -10);
133+
134+
let managed = @Struct { x: 300 };
135+
let _ = managed.self_by_ref(-11, -12);
136+
let _ = managed.self_by_val(-13, -14);
137+
let _ = managed.self_managed(-15, -16);
138+
}
139+
140+
fn zzz() {()}

0 commit comments

Comments
 (0)