Some more typestate tests.
This commit is contained in:
parent
d39753685b
commit
115e14a32c
|
@ -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 \
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -6,9 +6,5 @@ fn foo(int x) {
|
|||
|
||||
fn main() {
|
||||
let int x;
|
||||
if (1 > 2) {
|
||||
x = 10;
|
||||
} else {
|
||||
}
|
||||
foo(x);
|
||||
}
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue