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

This commit is contained in:
Drew P
2021-11-15 22:29:24 -08:00
committed by Andrew Kelley
parent a1d7604162
commit 30ed91b7b9
2 changed files with 6 additions and 0 deletions

View File

@@ -251,6 +251,9 @@ test "*const ?[*]const T to [*c]const [*c]const T" {
test "array coersion to undefined at runtime" {
@setRuntimeSafety(true);
// setRuntimeSafety isn't recognized on stage2
if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
var array = [4]u8{ 3, 4, 5, 6 };
var undefined_val = [4]u8{ 0xAA, 0xAA, 0xAA, 0xAA };

View File

@@ -20,6 +20,9 @@ test "uint128" {
test "undefined 128 bit int" {
@setRuntimeSafety(true);
// setRuntimeSafety isn't recognized on stage2
if (@import("builtin").zig_is_stage2 and (@import("builtin").mode != .Debug or @import("builtin").mode != .ReleaseSafe)) return error.SkipZigTest;
var undef: u128 = undefined;
var undef_signed: i128 = undefined;
try expect(undef == 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa and @bitCast(u128, undef_signed) == undef);