IR: port another test

This commit is contained in:
Andrew Kelley 2016-12-22 08:48:08 -05:00
parent 3e25ff65c3
commit ed962d9d21
2 changed files with 14 additions and 19 deletions

View File

@ -83,6 +83,20 @@ fn unwrapSimpleValueFromError() {
fn unwrapSimpleValueFromErrorDo() -> %isize { 13 }
fn errReturnInAssignment() {
@setFnTest(this);
%%doErrReturnInAssignment();
}
fn doErrReturnInAssignment() -> %void {
var x : i32 = undefined;
x = %return makeANonErr();
}
fn makeANonErr() -> %i32 {
return 1;
}

View File

@ -13,25 +13,6 @@ const test_enum_with_members = @import("cases/enum_with_members.zig");
const test_struct_contains_slice_of_itself = @import("cases/struct_contains_slice_of_itself.zig");
fn errReturnInAssignment() {
@setFnTest(this, true);
%%doErrReturnInAssignment();
}
fn doErrReturnInAssignment() -> %void {
@setFnStaticEval(this, false);
var x : i32 = undefined;
x = %return makeANonErr();
}
fn makeANonErr() -> %i32 {
return 1;
}
fn rhsMaybeUnwrapReturn() {
@setFnTest(this, true);