zig/doc/langref/inline_call.zig
Alex Kladov 96bb1137c2 langref: don't encourage printing to stderr in tests
The rule: `pub fn main` owns file descriptors 0, 1, and 2. If you didn't
write `pub fn main()` it is, in general, not your business to print to
stderr.
2025-07-14 17:32:50 +01:00

14 lines
251 B
Zig

const std = @import("std");
pub fn main() void {
if (foo(1200, 34) != 1234) {
@compileError("bad");
}
}
inline fn foo(a: i32, b: i32) i32 {
std.debug.print("runtime a = {} b = {}", .{ a, b });
return a + b;
}
// exe=succeed