zig/test/incremental/move_src
Andrew Kelley debf307594 update all incremental tests to new std API
they're still not passing on windows for some reason though
2025-12-23 22:15:11 -08:00

37 lines
935 B
Text

#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"