| author | |
| committer | |
| log | c6fb798740119b78def920c649c03a644fa2380b |
| tree | d1d266975176c81012c0a8e701f183ec2fd04149 |
| parent | 6cba18fe6062f0da277a0b3c94ca8eadb5ab87ca |
This reverts commit 67db2b85b771d8b0f9d765922951c31fce9c8cc2.3 files changed, 43 insertions(+), 0 deletions(-)
test/cases/plan9/exit.zig created+5| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | pub fn main() void {} | |
| 2 | ||
| 3 | // run | |
| 4 | // target=x86_64-plan9,aarch64-plan9 | |
| 5 | // |
test/cases/plan9/hello_world_with_updates.0.zig created+28| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | pub fn main() void { | |
| 2 | const str = "Hello World!\n"; | |
| 3 | asm volatile ( | |
| 4 | \\push $0 | |
| 5 | \\push %%r10 | |
| 6 | \\push %%r11 | |
| 7 | \\push $1 | |
| 8 | \\push $0 | |
| 9 | \\syscall | |
| 10 | \\pop %%r11 | |
| 11 | \\pop %%r11 | |
| 12 | \\pop %%r11 | |
| 13 | \\pop %%r11 | |
| 14 | \\pop %%r11 | |
| 15 | : | |
| 16 | // pwrite | |
| 17 | : [syscall_number] "{rbp}" (51), | |
| 18 | [hey] "{r11}" (@ptrToInt(str)), | |
| 19 | [strlen] "{r10}" (str.len), | |
| 20 | : "rcx", "rbp", "r11", "memory" | |
| 21 | ); | |
| 22 | } | |
| 23 | ||
| 24 | // run | |
| 25 | // target=x86_64-plan9 | |
| 26 | // | |
| 27 | // Hello World | |
| 28 | // |
test/cases/plan9/hello_world_with_updates.1.zig created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | const std = @import("std"); | |
| 2 | pub fn main() void { | |
| 3 | const str = "Hello World!\n"; | |
| 4 | _ = std.os.plan9.pwrite(1, str, str.len, 0); | |
| 5 | } | |
| 6 | ||
| 7 | // run | |
| 8 | // | |
| 9 | // Hello World | |
| 10 | // |