aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-18 16:01:29 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-18 18:10:59 +0100
commita239d8d4e2c0e5a7f3eb4b9973f869afdb3bbe05 (patch)
tree66e7d1d62876bb27414084283282c13317d123d9 /test
parentb745fee1f8dddd92c7d112cd7440e6b540458051 (diff)
downloadzig-a239d8d4e2c0e5a7f3eb4b9973f869afdb3bbe05.tar.gz
zig-a239d8d4e2c0e5a7f3eb4b9973f869afdb3bbe05.zip
test: add incremental case
Diffstat (limited to 'test')
-rw-r--r--test/incremental/type_becomes_comptime_only39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/incremental/type_becomes_comptime_only b/test/incremental/type_becomes_comptime_only
new file mode 100644
index 0000000000..2dfa556e87
--- /dev/null
+++ b/test/incremental/type_becomes_comptime_only
@@ -0,0 +1,39 @@
+#target=x86_64-linux
+#update=initial version
+#file=main.zig
+const SomeType = u32;
+const S = struct {
+ x: SomeType,
+ fn foo(_: S) void {}
+};
+pub fn main() void {
+ const s: S = .{ .x = 456 };
+ s.foo();
+}
+#expect_stdout=""
+
+#update=make S comptime-only
+#file=main.zig
+const SomeType = comptime_int;
+const S = struct {
+ x: SomeType,
+ fn foo(_: S) void {}
+};
+pub fn main() void {
+ const s: S = .{ .x = 456 };
+ s.foo();
+}
+#expect_stdout=""
+
+#update=make S runtime again
+#file=main.zig
+const SomeType = u16;
+const S = struct {
+ x: SomeType,
+ fn foo(_: S) void {}
+};
+pub fn main() void {
+ const s: S = .{ .x = 456 };
+ s.foo();
+}
+#expect_stdout=""