Commit 83e2d3fb37

Cody Tapscott <topolarity@tapscott.me>
2022-10-08 20:29:49
stage1: Skip new tests that never passed in stage1
This gets the behavior tests passing for stage1 again.
1 parent f5f28e0
test/behavior/bugs/11816.zig
@@ -3,6 +3,7 @@ const builtin = @import("builtin");
 
 test {
     if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
 
     var x: u32 = 3;
     const val: usize = while (true) switch (x) {
test/behavior/bugs/12723.zig
@@ -0,0 +1,11 @@
+const expect = @import("std").testing.expect;
+
+// This test causes a compile error on stage1 regardless of whether
+// the body of the test is comptime-gated or not. To workaround this,
+// we gate the inclusion of the test file.
+test "Non-exhaustive enum backed by comptime_int" {
+    const E = enum(comptime_int) { a, b, c, _ };
+    comptime var e: E = .a;
+    e = @intToEnum(E, 378089457309184723749);
+    try expect(@enumToInt(e) == 378089457309184723749);
+}
test/behavior/bugs/12801-1.zig
@@ -8,6 +8,7 @@ fn capacity_() u64 {
 
 test {
     if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
 
     try std.testing.expect((@This(){}).capacity() == 64);
 }
test/behavior/bugs/12801-2.zig
@@ -14,6 +14,7 @@ const Auto = struct {
     }
 };
 test {
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
     if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
     if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
     if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
test/behavior/align.zig
@@ -566,6 +566,8 @@ test "@alignCast null" {
 }
 
 test "alignment of slice element" {
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
+
     const a: []align(1024) const u8 = undefined;
     try expect(@TypeOf(&a[0]) == *align(1024) const u8);
 }
test/behavior/enum.zig
@@ -1169,10 +1169,3 @@ test "Non-exhaustive enum with nonstandard int size behaves correctly" {
     const E = enum(u15) { _ };
     try expect(@sizeOf(E) == @sizeOf(u15));
 }
-
-test "Non-exhaustive enum backed by comptime_int" {
-    const E = enum(comptime_int) { a, b, c, _ };
-    comptime var e: E = .a;
-    e = @intToEnum(E, 378089457309184723749);
-    try expect(@enumToInt(e) == 378089457309184723749);
-}
test/behavior/eval.zig
@@ -1339,6 +1339,8 @@ test "lazy value is resolved as slice operand" {
 }
 
 test "break from inline loop depends on runtime condition" {
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
+
     const S = struct {
         fn foo(a: u8) bool {
             return a == 4;
test/behavior/packed-struct.zig
@@ -585,6 +585,7 @@ test "runtime init of unnamed packed struct type" {
 }
 
 test "packed struct passed to callconv(.C) function" {
+    if (builtin.zig_backend == .stage1) return error.SkipZigTest;
     if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
     if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
     if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
test/behavior.zig
@@ -89,7 +89,6 @@ test {
     _ = @import("behavior/bugs/12551.zig");
     _ = @import("behavior/bugs/12644.zig");
     _ = @import("behavior/bugs/12680.zig");
-    _ = @import("behavior/bugs/12776.zig");
     _ = @import("behavior/bugs/12786.zig");
     _ = @import("behavior/bugs/12794.zig");
     _ = @import("behavior/bugs/12801-1.zig");
@@ -187,6 +186,8 @@ test {
         _ = @import("behavior/packed_struct_explicit_backing_int.zig");
         _ = @import("behavior/empty_union.zig");
         _ = @import("behavior/inline_switch.zig");
+        _ = @import("behavior/bugs/12723.zig");
+        _ = @import("behavior/bugs/12776.zig");
     }
 
     if (builtin.os.tag != .wasi) {