mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
33 lines
643 B
Plaintext
33 lines
643 B
Plaintext
#target=x86_64-linux-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 {
|
|
try std.io.getStdOut().writer().print("{d} {d}\n", .{ foo(), bar() });
|
|
}
|
|
fn foo() u32 {
|
|
return @src().line;
|
|
}
|
|
fn bar() u32 {
|
|
return 123;
|
|
}
|
|
#expect_stdout="6 123\n"
|
|
|
|
#update=add newline
|
|
#file=main.zig
|
|
const std = @import("std");
|
|
pub fn main() !void {
|
|
try std.io.getStdOut().writer().print("{d} {d}\n", .{ foo(), bar() });
|
|
}
|
|
|
|
fn foo() u32 {
|
|
return @src().line;
|
|
}
|
|
fn bar() u32 {
|
|
return 123;
|
|
}
|
|
#expect_stdout="7 123\n"
|