aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/cases/compile_errors/packed_struct_field_alignment_unavailable_for_reify_type.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cases/compile_errors/packed_struct_field_alignment_unavailable_for_reify_type.zig b/test/cases/compile_errors/packed_struct_field_alignment_unavailable_for_reify_type.zig
new file mode 100644
index 0000000000..8c17e9100b
--- /dev/null
+++ b/test/cases/compile_errors/packed_struct_field_alignment_unavailable_for_reify_type.zig
@@ -0,0 +1,11 @@
+export fn entry() void {
+ _ = @Type(.{ .Struct = .{ .layout = .Packed, .fields = &.{
+ .{ .name = "one", .field_type = u4, .default_value = null, .is_comptime = false, .alignment = 2 },
+ }, .decls = &.{}, .is_tuple = false } });
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :2:9: error: alignment in a packed struct field must be set to 0