authorgravatar for reserveblue@protonmail.comDrew P <reserveblue@protonmail.com> 2021-11-15 22:29:24-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-16 16:51:31-07:00
log30ed91b7b9f70d3f64e0c3a1a8d0eb0f3b499d50
treea0c742df6961a67f5553821bd185b497cce07ebf
parenta1d760416293b20b6a6a72f39a5957fbf22187cc

fix tests failing on stage2 release modes due to setRuntimeSafety not being recognized


2 files changed, 6 insertions(+), 0 deletions(-)

test/behavior/cast.zig+3
...@@ -251,6 +251,9 @@ test "*const ?[*]const T to [*c]const [*c]const T" {...@@ -251,6 +251,9 @@ test "*const ?[*]const T to [*c]const [*c]const T" {
251test "array coersion to undefined at runtime" {251test "array coersion to undefined at runtime" {
252 @setRuntimeSafety(true);252 @setRuntimeSafety(true);
253253
254 // setRuntimeSafety isn't recognized on stage2
255 if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
256
254 var array = [4]u8{ 3, 4, 5, 6 };257 var array = [4]u8{ 3, 4, 5, 6 };
255 var undefined_val = [4]u8{ 0xAA, 0xAA, 0xAA, 0xAA };258 var undefined_val = [4]u8{ 0xAA, 0xAA, 0xAA, 0xAA };
256259
test/behavior/int128.zig+3
...@@ -20,6 +20,9 @@ test "uint128" {...@@ -20,6 +20,9 @@ test "uint128" {
20test "undefined 128 bit int" {20test "undefined 128 bit int" {
21 @setRuntimeSafety(true);21 @setRuntimeSafety(true);
2222
23 // setRuntimeSafety isn't recognized on stage2
24 if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
25
23 var undef: u128 = undefined;26 var undef: u128 = undefined;
24 var undef_signed: i128 = undefined;27 var undef_signed: i128 = undefined;
25 try expect(undef == 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and @bitCast(u128, undef_signed) == undef);28 try expect(undef == 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and @bitCast(u128, undef_signed) == undef);