zig/test/cases/x86_64-macos/comptime_var.2.zig

18 lines
269 B
Zig
Raw Normal View History

extern "c" fn write(usize, usize, usize) usize;
pub fn main() void {
comptime var len: u32 = 5;
print(len);
len += 9;
print(len);
}
fn print(len: usize) void {
_ = write(1, @ptrToInt("Hello, World!\n"), len);
}
// run
//
// HelloHello, World!
//