aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/function_ptr_alignment.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-21 15:16:59 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-07-21 15:19:56 -0700
commit25f3be32db148c2816547c75462285ae8f5e99eb (patch)
treefa8d29a65b4c85737161180394a1357acb32ead1 /test/cases/compile_errors/function_ptr_alignment.zig
parentfc6e111b76764ae00e2c868ad46f39235837e239 (diff)
downloadzig-25f3be32db148c2816547c75462285ae8f5e99eb.tar.gz
zig-25f3be32db148c2816547c75462285ae8f5e99eb.zip
Sema: fix fn pointer align disagrees with fn align error
Check the specified function alignment rather than the effective function alignment.
Diffstat (limited to 'test/cases/compile_errors/function_ptr_alignment.zig')
-rw-r--r--test/cases/compile_errors/function_ptr_alignment.zig9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/cases/compile_errors/function_ptr_alignment.zig b/test/cases/compile_errors/function_ptr_alignment.zig
index ca0f3ee2ac..fabee524c7 100644
--- a/test/cases/compile_errors/function_ptr_alignment.zig
+++ b/test/cases/compile_errors/function_ptr_alignment.zig
@@ -16,10 +16,13 @@ comptime {
var a: *align(2) fn () void = undefined;
_ = a;
}
+comptime {
+ var a: *align(1) fn () align(2) void = undefined;
+ _ = a;
+}
// error
// backend=stage2
-// target=x86_64-linux
+// target=native
//
-// :2:19: error: function pointer alignment disagrees with function alignment
-// :16:19: error: function pointer alignment disagrees with function alignment
+// :20:19: error: function pointer alignment disagrees with function alignment