zig/test/cases/aarch64-linux/conditional_branches.1.zig

26 lines
387 B
Zig

pub fn main() void {
foo(true);
}
fn foo(x: bool) void {
if (x) {
print();
}
}
fn print() void {
asm volatile ("svc #0"
:
: [number] "{x8}" (64),
[arg1] "{x0}" (1),
[arg2] "{x1}" (@ptrToInt("Hello, World!\n")),
[arg3] "{x2}" ("Hello, World!\n".len),
: "memory", "cc"
);
}
// run
//
// Hello, World!
//