zig/test/incremental/modify_inline_fn
2025-10-02 17:44:52 -04:00

27 lines
627 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 {
const str = getStr();
try std.fs.File.stdout().writeAll(str);
}
inline fn getStr() []const u8 {
return "foo\n";
}
#expect_stdout="foo\n"
#update=change the string
#file=main.zig
const std = @import("std");
pub fn main() !void {
const str = getStr();
try std.fs.File.stdout().writeAll(str);
}
inline fn getStr() []const u8 {
return "bar\n";
}
#expect_stdout="bar\n"