| ... | @@ -1011,7 +1011,9 @@ test "cast from pointer to anonymous struct to pointer to union" { | ... | @@ -1011,7 +1011,9 @@ test "cast from pointer to anonymous struct to pointer to union" { |
| 1011 | } | 1011 | } |
| 1012 | | 1012 | |
| 1013 | test "switching on non exhaustive union" { | 1013 | test "switching on non exhaustive union" { |
| 1014 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO | 1014 | if (builtin.zig_backend == .stage1) return error.SkipZigTest; |
| | 1015 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 1016 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1015 | | 1017 | |
| 1016 | const S = struct { | 1018 | const S = struct { |
| 1017 | const E = enum(u8) { | 1019 | const E = enum(u8) { |
| ... | @@ -1027,7 +1029,8 @@ test "switching on non exhaustive union" { | ... | @@ -1027,7 +1029,8 @@ test "switching on non exhaustive union" { |
| 1027 | var a = U{ .a = 2 }; | 1029 | var a = U{ .a = 2 }; |
| 1028 | switch (a) { | 1030 | switch (a) { |
| 1029 | .a => |val| try expect(val == 2), | 1031 | .a => |val| try expect(val == 2), |
| 1030 | .b => unreachable, | 1032 | .b => return error.Fail, |
| | 1033 | _ => return error.Fail, |
| 1031 | } | 1034 | } |
| 1032 | } | 1035 | } |
| 1033 | }; | 1036 | }; |
| ... | @@ -1036,7 +1039,9 @@ test "switching on non exhaustive union" { | ... | @@ -1036,7 +1039,9 @@ test "switching on non exhaustive union" { |
| 1036 | } | 1039 | } |
| 1037 | | 1040 | |
| 1038 | test "containers with single-field enums" { | 1041 | test "containers with single-field enums" { |
| 1039 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO | 1042 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 1043 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 1044 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1040 | | 1045 | |
| 1041 | const S = struct { | 1046 | const S = struct { |
| 1042 | const A = union(enum) { f1 }; | 1047 | const A = union(enum) { f1 }; |
| ... | @@ -1061,8 +1066,10 @@ test "containers with single-field enums" { | ... | @@ -1061,8 +1066,10 @@ test "containers with single-field enums" { |
| 1061 | comptime try S.doTheTest(); | 1066 | comptime try S.doTheTest(); |
| 1062 | } | 1067 | } |
| 1063 | | 1068 | |
| 1064 | test "@unionInit on union w/ tag but no fields" { | 1069 | test "@unionInit on union with tag but no fields" { |
| 1065 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO | 1070 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 1071 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 1072 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| 1066 | | 1073 | |
| 1067 | const S = struct { | 1074 | const S = struct { |
| 1068 | const Type = enum(u8) { no_op = 105 }; | 1075 | const Type = enum(u8) { no_op = 105 }; |
| ... | @@ -1077,7 +1084,11 @@ test "@unionInit on union w/ tag but no fields" { | ... | @@ -1077,7 +1084,11 @@ test "@unionInit on union w/ tag but no fields" { |
| 1077 | }; | 1084 | }; |
| 1078 | | 1085 | |
| 1079 | comptime { | 1086 | comptime { |
| 1080 | std.debug.assert(@sizeOf(Data) != 0); | 1087 | if (builtin.zig_backend == .stage1) { |
| | 1088 | // stage1 gets the wrong answer here |
| | 1089 | } else { |
| | 1090 | std.debug.assert(@sizeOf(Data) == 0); |
| | 1091 | } |
| 1081 | } | 1092 | } |
| 1082 | | 1093 | |
| 1083 | fn doTheTest() !void { | 1094 | fn doTheTest() !void { |