authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-19 09:06:54+01:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2024-08-21 01:30:46+01:00
logceb76b2ba705f362dbd5437ec5804b670298b420
treeae632a9149df82cf8746b11c161895b5f26c88dd
parent43fdd061f7430794c142283101f9c97a0829d446
signaturelock-open Commit is signed but in an unrecognized format.

test: add incremental compilation test for moving `@src()` call


1 files changed, 29 insertions(+), 0 deletions(-)

test/incremental/move_src created+29
...@@ -0,0 +1,29 @@
1#target=x86_64-linux
2#update=initial version
3#file=main.zig
4const std = @import("std");
5pub fn main() !void {
6 try std.io.getStdOut().writer().print("{d} {d}\n", .{ foo(), bar() });
7}
8fn foo() u32 {
9 return @src().line;
10}
11fn bar() u32 {
12 return 123;
13}
14#expect_stdout="6 123\n"
15
16#update=add newline
17#file=main.zig
18const std = @import("std");
19pub fn main() !void {
20 try std.io.getStdOut().writer().print("{d} {d}\n", .{ foo(), bar() });
21}
22
23fn foo() u32 {
24 return @src().line;
25}
26fn bar() u32 {
27 return 123;
28}
29#expect_stdout="7 123\n"