aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/enum.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-08-28 13:37:38 +0300
committerVeikka Tuominen <git@vexu.eu>2022-08-28 15:41:21 +0300
commit776caaf99927181a2bb135afa9b502014782691c (patch)
treea67bbeb7166fe7badbed7790024c98c625808e96 /test/behavior/enum.zig
parent6aead18ab332a3cf809b5c824d70cdc52f0e5156 (diff)
downloadzig-776caaf99927181a2bb135afa9b502014782691c.tar.gz
zig-776caaf99927181a2bb135afa9b502014782691c.zip
Sema: fix handling of non-standard int types in empty non-exhaustive enums
Closes #12649
Diffstat (limited to 'test/behavior/enum.zig')
-rw-r--r--test/behavior/enum.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/behavior/enum.zig b/test/behavior/enum.zig
index 9e96163cc0..517414780b 100644
--- a/test/behavior/enum.zig
+++ b/test/behavior/enum.zig
@@ -1170,3 +1170,8 @@ test "switch on an extern enum with negative value" {
Foo.Bar => return,
}
}
+
+test "Non-exhaustive enum with nonstandard int size behaves correctly" {
+ const E = enum(u15) { _ };
+ try expect(@sizeOf(E) == @sizeOf(u15));
+}