2011-06-15 18:23:17 -05:00
|
|
|
// xfail-stage0
|
2011-06-16 13:56:34 -05:00
|
|
|
pred even(uint x) -> bool {
|
2011-06-17 13:10:51 -05:00
|
|
|
if (x < 2u) {
|
2011-06-16 13:56:34 -05:00
|
|
|
ret false;
|
|
|
|
}
|
2011-06-17 13:10:51 -05:00
|
|
|
else if (x == 2u) {
|
2011-06-16 13:56:34 -05:00
|
|
|
ret true;
|
|
|
|
}
|
|
|
|
else {
|
2011-06-17 13:10:51 -05:00
|
|
|
ret even(x - 2u);
|
2011-06-16 13:56:34 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo(uint x) -> () {
|
|
|
|
if check(even(x)) {
|
2011-06-15 18:23:17 -05:00
|
|
|
log x;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
fail;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-06-16 13:56:34 -05:00
|
|
|
foo(2u);
|
|
|
|
}
|