Some more typestate tests.

This commit is contained in:
Graydon Hoare 2010-07-08 07:33:25 -07:00
parent d39753685b
commit 115e14a32c
5 changed files with 42 additions and 4 deletions

View File

@ -451,6 +451,7 @@ TEST_XFAILS_LLVM := $(addprefix test/run-pass/, \
u8-incr.rs \
unit.rs \
user.rs \
use-uninit.rs \
utf8.rs \
vec-append.rs \
vec-concat.rs \

View File

@ -0,0 +1,13 @@
// error-pattern:Unsatisfied precondition
fn foo(int x) {
log x;
}
fn main() {
let int x;
if (1 > 2) {
x = 10;
}
foo(x);
}

View File

@ -0,0 +1,15 @@
// error-pattern:Unsatisfied precondition
fn foo(int x) {
log x;
}
fn main() {
let int x;
if (1 > 2) {
log "whoops";
} else {
x = 10;
}
foo(x);
}

View File

@ -6,9 +6,5 @@ fn foo(int x) {
fn main() {
let int x;
if (1 > 2) {
x = 10;
} else {
}
foo(x);
}

View File

@ -0,0 +1,13 @@
fn foo(int x) {
log x;
}
fn main() {
let int x;
if (1 > 2) {
x = 12;
} else {
x = 10;
}
foo(x);
}