| ... | @@ -133,6 +133,20 @@ test "alignment and size of structs with 128-bit fields" { | ... | @@ -133,6 +133,20 @@ test "alignment and size of structs with 128-bit fields" { |
| 133 | y: u8, | 133 | y: u8, |
| 134 | }; | 134 | }; |
| 135 | const expected = switch (builtin.cpu.arch) { | 135 | const expected = switch (builtin.cpu.arch) { |
| | 136 | .s390x, |
| | 137 | => .{ |
| | 138 | .a_align = 8, |
| | 139 | .a_size = 16, |
| | 140 | |
| | 141 | .b_align = 8, |
| | 142 | .b_size = 24, |
| | 143 | |
| | 144 | .u128_align = 8, |
| | 145 | .u128_size = 16, |
| | 146 | .u129_align = 8, |
| | 147 | .u129_size = 24, |
| | 148 | }, |
| | 149 | |
| 136 | .amdgcn, | 150 | .amdgcn, |
| 137 | .arm, | 151 | .arm, |
| 138 | .armeb, | 152 | .armeb, |
| ... | @@ -145,7 +159,6 @@ test "alignment and size of structs with 128-bit fields" { | ... | @@ -145,7 +159,6 @@ test "alignment and size of structs with 128-bit fields" { |
| 145 | .powerpc, | 159 | .powerpc, |
| 146 | .powerpcle, | 160 | .powerpcle, |
| 147 | .riscv32, | 161 | .riscv32, |
| 148 | .s390x, | | |
| 149 | => .{ | 162 | => .{ |
| 150 | .a_align = 8, | 163 | .a_align = 8, |
| 151 | .a_size = 16, | 164 | .a_size = 16, |
| ... | @@ -191,7 +204,7 @@ test "alignment and size of structs with 128-bit fields" { | ... | @@ -191,7 +204,7 @@ test "alignment and size of structs with 128-bit fields" { |
| 191 | | 204 | |
| 192 | else => return error.SkipZigTest, | 205 | else => return error.SkipZigTest, |
| 193 | }; | 206 | }; |
| 194 | const min_struct_align = if (builtin.zig_backend == .stage2_c) 16 else 0; | 207 | const min_struct_align = if (builtin.zig_backend == .stage2_c) if (builtin.cpu.arch == .s390x) 8 else 16 else 0; |
| 195 | comptime { | 208 | comptime { |
| 196 | assert(@alignOf(A) == @max(expected.a_align, min_struct_align)); | 209 | assert(@alignOf(A) == @max(expected.a_align, min_struct_align)); |
| 197 | assert(@sizeOf(A) == expected.a_size); | 210 | assert(@sizeOf(A) == expected.a_size); |