aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/tuple.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-11-12 13:11:54 +0200
committerVeikka Tuominen <git@vexu.eu>2022-11-12 15:41:29 +0200
commit87cf2783ebdf96e3dfa1c24a53dba301591d5f07 (patch)
tree5496dc171c02f076952ffa303137d23b31aeb1c6 /test/behavior/tuple.zig
parenta760ce598c7656f7582d8305582e374af68254d9 (diff)
downloadzig-87cf2783ebdf96e3dfa1c24a53dba301591d5f07.tar.gz
zig-87cf2783ebdf96e3dfa1c24a53dba301591d5f07.zip
llvm: check that tuple fields have runtime bits
Just checking that they aren't comptime isn't enough for `@Type` constructed tuples. Closes #13531
Diffstat (limited to 'test/behavior/tuple.zig')
-rw-r--r--test/behavior/tuple.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/tuple.zig b/test/behavior/tuple.zig
index f9a1603a5f..a172587554 100644
--- a/test/behavior/tuple.zig
+++ b/test/behavior/tuple.zig
@@ -323,3 +323,13 @@ test "zero sized struct in tuple handled correctly" {
var s: State = undefined;
try expect(s.do() == 0);
}
+
+test "tuple type with void field and a runtime field" {
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
+
+ const T = std.meta.Tuple(&[_]type{ usize, void });
+ var t: T = .{ 5, {} };
+ try expect(t[0] == 5);
+}