rust/src/test/run-pass/artificial-block.rs
Marijn Haverbeke 3d738e9e06 Return a fresh, unreachable context after ret, break, and cont
This ensures we don't get compile errors on unreachable code (see
test/run-pass/artificial-block.rs for an example of sane code that
wasn't compiling). In the future, we might want to warn about
non-trivial code appearing in an unreachable context, and/or avoid
generating unreachable code altogether (though I'm sure LLVM will weed
it out as well).
2011-05-05 20:19:43 +02:00

11 lines
88 B
Rust

// xfail-stage0
fn f() -> int {
{ ret 3; }
}
fn main() {
assert(f() == 3);
}