Skip to content

Commit 956bc69

Browse files
committed
Add more unwind tests for failure during construction of allocated things
1 parent 80778f6 commit 956bc69

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// error-pattern:fail
2+
3+
fn f() -> [int] { fail; }
4+
5+
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
6+
// have been to do with memory allocation patterns.
7+
fn prime() {
8+
@0;
9+
}
10+
11+
fn partial() {
12+
let x = @f();
13+
}
14+
15+
fn main() {
16+
prime();
17+
partial();
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// error-pattern:fail
2+
3+
fn f() -> [int] { fail; }
4+
5+
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
6+
// have been to do with memory allocation patterns.
7+
fn prime() {
8+
@0;
9+
}
10+
11+
fn partial() {
12+
let x = [[0], f(), [0]];
13+
}
14+
15+
fn main() {
16+
prime();
17+
partial();
18+
}

0 commit comments

Comments
 (0)