Un-XFAIL do-while-body-fails

Made it work both with optimization enabled, and with optimization
disabled. Huzzah!
This commit is contained in:
Tim Chevalier 2011-08-12 16:15:03 -07:00
parent 60e1cead9b
commit c01e487485
2 changed files with 8 additions and 4 deletions

View File

@ -3805,7 +3805,14 @@ fn trans_do_while(cx: &@block_ctxt, body: &ast::blk, cond: &@ast::expr) ->
if is_terminated(body_res.bcx) {
// This is kind of ridiculous, but no permutations
// involving body_res or body_cx.val worked.
ret trans_block(cx, body, return);
let rs = trans_block(cx, body, return);
if ! is_terminated (next_cx) {
next_cx.build.Unreachable();
}
if ! is_terminated (body_cx) {
body_cx.build.Unreachable();
}
ret rs;
}
let cond_res = trans_expr(body_res.bcx, cond);
cond_res.bcx.build.CondBr(cond_res.val, body_cx.llbb, next_cx.llbb);

View File

@ -1,6 +1,3 @@
// xfail-stage1
// xfail-stage2
// xfail-stage3
// error-pattern:quux
fn main() {
let x: int = do { fail "quux" } while (true);