test: add incremental case

This commit is contained in:
mlugg 2024-08-18 16:01:29 +01:00
parent b745fee1f8
commit a239d8d4e2
No known key found for this signature in database
GPG Key ID: 3F5B7DCCBF4AF02E

View File

@ -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=""