commit 825da34769784c7bdfa0d6be325c7299d992a951 (tree) parent fb523c6283be546369250b9172aad040d44f42dd Author: kcbanner <kcbanner@gmail.com> Date: Wed, 25 Oct 2023 13:27:29 -0400 Add compile error test case for union layout depending on pointer alignment Diffstat:
| A | test/cases/compile_errors/union_depends_on_pointer_alignment.zig | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/test/cases/compile_errors/union_depends_on_pointer_alignment.zig b/test/cases/compile_errors/union_depends_on_pointer_alignment.zig @@ -0,0 +1,11 @@ +const U = union { + next: ?*align(1) U align(128), +}; + +export fn entry() usize { + return @alignOf(U); +} + +// error +// +// :1:11: error: union layout depends on being pointer aligned