diff --git a/test/behavior/array.zig b/test/behavior/array.zig index b28ee267c2e03a1a1b758ea6256b7f3fc23ebb09..2bd85555297beed2d7b33de499e272ddc639a175 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -539,28 +539,6 @@ test "sentinel element count towards the ABI size calculation" { try comptime S.doTheTest(); } -test "zero-sized array with recursive type definition" { - if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; - - const U = struct { - fn foo(comptime T: type, comptime n: usize) type { - return struct { - s: [n]T, - x: usize = n, - }; - } - }; - - const S = struct { - list: U.foo(@This(), 0), - }; - - var t: S = .{ .list = .{ .s = undefined } }; - _ = &t; - try expect(@as(usize, 0) == t.list.x); -} - test "type coercion of anon struct literal to array" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; diff --git a/test/behavior/sizeof_and_typeof.zig b/test/behavior/sizeof_and_typeof.zig index 65deede0768638791f5da2cb4b74db82ea6c0caa..cb6c334cb7448bdd403c419baaad2eb9d92443d9 100644 --- a/test/behavior/sizeof_and_typeof.zig +++ b/test/behavior/sizeof_and_typeof.zig @@ -120,21 +120,6 @@ test "@bitOffsetOf" { try expect(@offsetOf(A, "g") * 8 == @bitOffsetOf(A, "g")); } -test "@sizeOf(T) == 0 doesn't force resolving struct size" { - const S = struct { - const Foo = struct { - y: if (@sizeOf(Foo) == 0) u64 else u32, - }; - const Bar = struct { - x: i32, - y: if (0 == @sizeOf(Bar)) u64 else u32, - }; - }; - - try expect(@sizeOf(S.Foo) == 4); - try expect(@sizeOf(S.Bar) == 8); -} - test "@TypeOf() has no runtime side effects" { const S = struct { fn foo(comptime T: type, ptr: *T) T { diff --git a/test/behavior/struct_contains_slice_of_itself.zig b/test/behavior/struct_contains_slice_of_itself.zig index 5cf8d8134a1cc91abbc392c0acf7c1765f3e50bc..541babee6bb62d10cf05f141545eafe9766aefd7 100644 --- a/test/behavior/struct_contains_slice_of_itself.zig +++ b/test/behavior/struct_contains_slice_of_itself.zig @@ -8,7 +8,7 @@ const Node = struct { const NodeAligned = struct { payload: i32, - children: []align(@alignOf(NodeAligned)) NodeAligned, + children: []align(1) NodeAligned, }; test "struct contains slice of itself" {