aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/align.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-04-30 19:51:35 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-08 19:37:29 -0700
commit200e06b2399d605c8d183e55649e39ba2c6b56f6 (patch)
tree9bdd2acf67740b9de522545abb8684e602181d22 /test/behavior/align.zig
parent927f24a6ff4af55f79df54c392b906413eae1459 (diff)
downloadzig-200e06b2399d605c8d183e55649e39ba2c6b56f6.tar.gz
zig-200e06b2399d605c8d183e55649e39ba2c6b56f6.zip
update maxIntAlignment for x86 to 16
LLVMABIAlignmentOfType(i128) reports 16 on this target, however the C ABI uses align(4). Clang in LLVM 17 does this: %struct.foo = type { i32, i128 } Clang in LLVM 18 does this: %struct.foo = type <{ i32, i128 }> Clang is working around the 16-byte alignment to use align(4) for the C ABI by making the LLVM struct packed.
Diffstat (limited to 'test/behavior/align.zig')
-rw-r--r--test/behavior/align.zig39
1 files changed, 1 insertions, 38 deletions
diff --git a/test/behavior/align.zig b/test/behavior/align.zig
index 53c7455dbf..34d76fb4ba 100644
--- a/test/behavior/align.zig
+++ b/test/behavior/align.zig
@@ -114,44 +114,6 @@ test "alignment and size of structs with 128-bit fields" {
.u129_size = 24,
},
- .x86 => if (builtin.object_format == .c) .{
- .a_align = 16,
- .a_size = 16,
-
- .b_align = 16,
- .b_size = 32,
-
- .u128_align = 16,
- .u128_size = 16,
- .u129_align = 16,
- .u129_size = 32,
- } else switch (builtin.os.tag) {
- .windows => .{
- .a_align = 8,
- .a_size = 16,
-
- .b_align = 16,
- .b_size = 32,
-
- .u128_align = 8,
- .u128_size = 16,
- .u129_align = 8,
- .u129_size = 24,
- },
- else => .{
- .a_align = 4,
- .a_size = 16,
-
- .b_align = 16,
- .b_size = 32,
-
- .u128_align = 4,
- .u128_size = 16,
- .u129_align = 4,
- .u129_size = 20,
- },
- },
-
.mips64,
.mips64el,
.powerpc64,
@@ -211,6 +173,7 @@ test "alignment and size of structs with 128-bit fields" {
},
},
+ .x86,
.aarch64,
.aarch64_be,
.aarch64_32,