diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-01-17 21:55:49 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-17 21:55:49 -0700 |
| commit | 4d05f2ae5f7b79f8abb4aa07d846a46470ffdb1a (patch) | |
| tree | 930c4dc2aa77d420fd66917136cb1c0e2514f2e6 /test/behavior | |
| parent | 84c2c47fae82e913286a2306d8947252ae3a42f7 (diff) | |
| download | zig-4d05f2ae5f7b79f8abb4aa07d846a46470ffdb1a.tar.gz zig-4d05f2ae5f7b79f8abb4aa07d846a46470ffdb1a.zip | |
remove `zig_is_stage2` from `@import("builtin")`
Instead use the standarized option for communicating the
zig compiler backend at comptime, which is `zig_backend`. This was
introduced in commit 1c24ef0d0b09a12a1fe98056f2fc04de78a82df3.
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/array.zig | 2 | ||||
| -rw-r--r-- | test/behavior/atomics.zig | 2 | ||||
| -rw-r--r-- | test/behavior/basic.zig | 2 | ||||
| -rw-r--r-- | test/behavior/bugs/2006.zig | 2 | ||||
| -rw-r--r-- | test/behavior/bugs/6850.zig | 2 | ||||
| -rw-r--r-- | test/behavior/cast.zig | 2 | ||||
| -rw-r--r-- | test/behavior/generics.zig | 2 | ||||
| -rw-r--r-- | test/behavior/int128.zig | 2 | ||||
| -rw-r--r-- | test/behavior/struct.zig | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig index 017d15a64b..d512e50687 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -111,7 +111,7 @@ test "array with sentinels" { const S = struct { fn doTheTest(is_ct: bool) !void { - if (is_ct or builtin.zig_is_stage2) { + if (is_ct or builtin.zig_backend != .stage1) { var zero_sized: [0:0xde]u8 = [_:0xde]u8{}; // Stage1 test coverage disabled at runtime because of // https://github.com/ziglang/zig/issues/4372 diff --git a/test/behavior/atomics.zig b/test/behavior/atomics.zig index 0643b62fe3..efb4e32960 100644 --- a/test/behavior/atomics.zig +++ b/test/behavior/atomics.zig @@ -88,7 +88,7 @@ test "128-bit cmpxchg" { } fn test_u128_cmpxchg() !void { - if (builtin.zig_is_stage2) { + if (builtin.zig_backend != .stage1) { if (builtin.cpu.arch != .x86_64) return error.SkipZigTest; if (!builtin.stage2_x86_cx16) return error.SkipZigTest; } else { diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig index cca2d63cd7..9064339877 100644 --- a/test/behavior/basic.zig +++ b/test/behavior/basic.zig @@ -180,7 +180,7 @@ const OpaqueB = opaque {}; test "opaque types" { try expect(*OpaqueA != *OpaqueB); - if (!builtin.zig_is_stage2) { + if (builtin.zig_backend == .stage1) { // TODO make this pass for stage2 try expect(mem.eql(u8, @typeName(OpaqueA), "OpaqueA")); try expect(mem.eql(u8, @typeName(OpaqueB), "OpaqueB")); } diff --git a/test/behavior/bugs/2006.zig b/test/behavior/bugs/2006.zig index 4f41553b8e..bf9849abb2 100644 --- a/test/behavior/bugs/2006.zig +++ b/test/behavior/bugs/2006.zig @@ -8,7 +8,7 @@ test "bug 2006" { var a: S = undefined; a = S{ .p = undefined }; try expect(@sizeOf(S) != 0); - if (@import("builtin").zig_is_stage2) { + if (@import("builtin").zig_backend != .stage1) { // It is an accepted proposal to make `@sizeOf` for pointers independent // of whether the element type is zero bits. // This language change has not been implemented in stage1. diff --git a/test/behavior/bugs/6850.zig b/test/behavior/bugs/6850.zig index ad4292cc09..7bab4d347a 100644 --- a/test/behavior/bugs/6850.zig +++ b/test/behavior/bugs/6850.zig @@ -8,7 +8,7 @@ test "lazy sizeof comparison with zero" { } fn hasNoBits(comptime T: type) bool { - if (@import("builtin").zig_is_stage2) { + if (@import("builtin").zig_backend != .stage1) { // It is an accepted proposal to make `@sizeOf` for pointers independent // of whether the element type is zero bits. // This language change has not been implemented in stage1. diff --git a/test/behavior/cast.zig b/test/behavior/cast.zig index c2eb49f854..1e7a5a4687 100644 --- a/test/behavior/cast.zig +++ b/test/behavior/cast.zig @@ -246,7 +246,7 @@ test "array coersion to undefined at runtime" { @setRuntimeSafety(true); // TODO implement @setRuntimeSafety in stage2 - if (builtin.zig_is_stage2 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) { + if (builtin.zig_backend != .stage1 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) { return error.SkipZigTest; } diff --git a/test/behavior/generics.zig b/test/behavior/generics.zig index 6cb1a82e3e..f1107cef07 100644 --- a/test/behavior/generics.zig +++ b/test/behavior/generics.zig @@ -19,7 +19,7 @@ fn checkSize(comptime T: type) usize { test "simple generic fn" { try expect(max(i32, 3, -1) == 3); try expect(max(u8, 1, 100) == 100); - if (!builtin.zig_is_stage2) { + if (builtin.zig_backend == .stage1) { // TODO: stage2 is incorrectly emitting the following: // error: cast of value 1.23e-01 to type 'f32' loses information try expect(max(f32, 0.123, 0.456) == 0.456); diff --git a/test/behavior/int128.zig b/test/behavior/int128.zig index 6bf0eca11e..feb2617994 100644 --- a/test/behavior/int128.zig +++ b/test/behavior/int128.zig @@ -22,7 +22,7 @@ test "undefined 128 bit int" { @setRuntimeSafety(true); // TODO implement @setRuntimeSafety in stage2 - if (builtin.zig_is_stage2 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) { + if (builtin.zig_backend != .stage1 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) { return error.SkipZigTest; } diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig index b5841c58fb..40310f8add 100644 --- a/test/behavior/struct.zig +++ b/test/behavior/struct.zig @@ -213,7 +213,7 @@ test "packed struct field alignment" { b: u32 align(1), } = undefined; }; - const S = if (builtin.zig_is_stage2) Stage2 else Stage1; + const S = if (builtin.zig_backend != .stage1) Stage2 else Stage1; try expect(@TypeOf(&S.baz.b) == *align(1) u32); } |
