Skip to content

Commit 616a507

Browse files
committed
---
yaml --- r: 3507 b: refs/heads/master c: 6346a67 h: refs/heads/master i: 3505: 7664bd9 3503: 2a74767 v: v3
1 parent af1392c commit 616a507

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 7fd04a21a1f335cf5fb335e33f6e84d4d29fbef1
2+
refs/heads/master: 6346a67cbd96f0c1faf483851e1f120334862309
Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,74 @@
11
// xfail-stage0
22

3+
#[cfg(bogus)]
4+
const bool b = false;
5+
6+
const bool b = true;
7+
8+
#[cfg(bogus)]
9+
native "rust" mod rustrt {
10+
// This symbol doesn't exist and would be a link error if this
11+
// module was translated
12+
fn bogus();
13+
}
14+
15+
native "rust" mod rustrt {
16+
}
17+
18+
#[cfg(bogus)]
19+
type t = int;
20+
21+
type t = bool;
22+
23+
#[cfg(bogus)]
24+
tag tg {
25+
foo;
26+
}
27+
28+
tag tg {
29+
bar;
30+
}
31+
32+
#[cfg(bogus)]
33+
obj o() {
34+
fn f() { ret bogus; }
35+
}
36+
37+
obj o() {
38+
}
39+
40+
#[cfg(bogus)]
41+
resource r(int i) {}
42+
43+
resource r(int i) {}
44+
45+
#[cfg(bogus)]
46+
mod m {
47+
// This needs to parse but would fail in typeck. Since it's not in
48+
// the current config it should not be typechecked.
49+
fn bogus() { ret 0; }
50+
}
51+
52+
mod m {
53+
54+
// Submodules have slightly different code paths than the top-level
55+
// module, so let's make sure this jazz works here as well
56+
#[cfg(bogus)]
57+
fn f() {}
58+
59+
fn f() {}
60+
}
61+
362
// Since the bogus configuration isn't defined main will just be
463
// parsed, but nothing further will be done with it
564
#[cfg(bogus)]
665
fn main() { fail }
766

8-
fn main() {}
67+
fn main() {
68+
// Exercise some of the configured items in ways that wouldn't be possible
69+
// if they had the bogus definition
70+
assert b;
71+
let t x = true;
72+
let tg y = bar;
73+
}
74+

0 commit comments

Comments
 (0)