File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ pub fn addCases(ctx: *TestContext) !void {
20
20
try @import ("stage2/wasm.zig" ).addCases (ctx );
21
21
try @import ("stage2/darwin.zig" ).addCases (ctx );
22
22
try @import ("stage2/riscv64.zig" ).addCases (ctx );
23
+ try @import ("stage2/plan9.zig" ).addCases (ctx );
23
24
24
25
{
25
26
var case = ctx .exe ("hello world with updates" , linux_x64 );
Original file line number Diff line number Diff line change
1
+ const std = @import ("std" );
2
+ const TestContext = @import ("../../src/test.zig" ).TestContext ;
3
+
4
+ pub fn addCases (ctx : * TestContext ) ! void {
5
+ const target : std.zig.CrossTarget = .{
6
+ .cpu_arch = .x86_64 ,
7
+ .os_tag = .plan9 ,
8
+ };
9
+ {
10
+ var case = ctx .exe ("plan9: exiting correctly" , target );
11
+ case .addCompareOutput ("pub fn main() void {}" , "" );
12
+ }
13
+ {
14
+ var case = ctx .exe ("plan9: hello world" , target );
15
+ case .addCompareOutput (
16
+ \\pub fn main() void {
17
+ \\ const str = "Hello World!\n";
18
+ \\ asm volatile (
19
+ \\ \\push $0
20
+ \\ \\push %%r10
21
+ \\ \\push %%r11
22
+ \\ \\push $1
23
+ \\ \\push $0
24
+ \\ \\syscall
25
+ \\ \\pop %%r11
26
+ \\ \\pop %%r11
27
+ \\ \\pop %%r11
28
+ \\ \\pop %%r11
29
+ \\ \\pop %%r11
30
+ \\ :
31
+ \\ // pwrite
32
+ \\ : [syscall_number] "{rbp}" (51),
33
+ \\ [hey] "{r11}" (@ptrToInt(str)),
34
+ \\ [strlen] "{r10}" (str.len)
35
+ \\ : "rcx", "rbp", "r11", "memory"
36
+ \\ );
37
+ \\}
38
+ , "" );
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments