zig/test/cases/arm-linux/errors.1.zig

25 lines
391 B
Zig
Raw Normal View History

2022-04-27 23:09:26 +01:00
pub fn main() void {
foo() catch print();
}
fn foo() anyerror!void {
return error.Test;
}
fn print() void {
asm volatile ("svc #0"
:
: [number] "{r7}" (4),
[arg1] "{r0}" (1),
[arg2] "{r1}" (@ptrToInt("Hello, World!\n")),
[arg3] "{r2}" ("Hello, World!\n".len),
: "memory"
);
return;
}
// run
//
// Hello, World!
//