mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
Revert "remove plan9 test coverage": Plan9 now works :^)
This reverts commit 67db2b85b771d8b0f9d765922951c31fce9c8cc2.
This commit is contained in:
parent
6cba18fe60
commit
c6fb798740
5
test/cases/plan9/exit.zig
Normal file
5
test/cases/plan9/exit.zig
Normal file
@ -0,0 +1,5 @@
|
||||
pub fn main() void {}
|
||||
|
||||
// run
|
||||
// target=x86_64-plan9,aarch64-plan9
|
||||
//
|
||||
28
test/cases/plan9/hello_world_with_updates.0.zig
Normal file
28
test/cases/plan9/hello_world_with_updates.0.zig
Normal file
@ -0,0 +1,28 @@
|
||||
pub fn main() void {
|
||||
const str = "Hello World!\n";
|
||||
asm volatile (
|
||||
\\push $0
|
||||
\\push %%r10
|
||||
\\push %%r11
|
||||
\\push $1
|
||||
\\push $0
|
||||
\\syscall
|
||||
\\pop %%r11
|
||||
\\pop %%r11
|
||||
\\pop %%r11
|
||||
\\pop %%r11
|
||||
\\pop %%r11
|
||||
:
|
||||
// pwrite
|
||||
: [syscall_number] "{rbp}" (51),
|
||||
[hey] "{r11}" (@ptrToInt(str)),
|
||||
[strlen] "{r10}" (str.len),
|
||||
: "rcx", "rbp", "r11", "memory"
|
||||
);
|
||||
}
|
||||
|
||||
// run
|
||||
// target=x86_64-plan9
|
||||
//
|
||||
// Hello World
|
||||
//
|
||||
10
test/cases/plan9/hello_world_with_updates.1.zig
Normal file
10
test/cases/plan9/hello_world_with_updates.1.zig
Normal file
@ -0,0 +1,10 @@
|
||||
const std = @import("std");
|
||||
pub fn main() void {
|
||||
const str = "Hello World!\n";
|
||||
_ = std.os.plan9.pwrite(1, str, str.len, 0);
|
||||
}
|
||||
|
||||
// run
|
||||
//
|
||||
// Hello World
|
||||
//
|
||||
Loading…
x
Reference in New Issue
Block a user