aboutsummaryrefslogtreecommitdiff
path: root/test/incremental/move_src
blob: b79a25df8df11002a6d4e7b1bf78c976ea760372 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#target=x86_64-linux-selfhosted
#target=x86_64-windows-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
#target=wasm32-wasi-selfhosted
#update=initial version
#file=main.zig
const std = @import("std");
pub fn main() !void {
    var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
    try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() });
}
fn foo() u32 {
    return @src().line;
}
fn bar() u32 {
    return 123;
}
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_stdout="7 123\n"

#update=add newline
#file=main.zig
const std = @import("std");
pub fn main() !void {
    var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{});
    try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() });
}

fn foo() u32 {
    return @src().line;
}
fn bar() u32 {
    return 123;
}
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_stdout="8 123\n"