| ... | ... | @@ -0,0 +1,39 @@ |
| 1 | const std = @import("std"); |
| 2 | const TestContext = @import("../../src/test.zig").TestContext; |
| 3 | |
| 4 | const linux_sparcv9 = std.zig.CrossTarget{ |
| 5 | .cpu_arch = .sparcv9, |
| 6 | .os_tag = .linux, |
| 7 | }; |
| 8 | |
| 9 | pub fn addCases(ctx: *TestContext) !void { |
| 10 | { |
| 11 | var case = ctx.exe("sparcv9 hello world", linux_sparcv9); |
| 12 | // Regular old hello world |
| 13 | case.addCompareOutput( |
| 14 | \\const msg = "Hello, World!\n"; |
| 15 | \\ |
| 16 | \\pub export fn _start() noreturn { |
| 17 | \\ asm volatile ("ta 0x6d" |
| 18 | \\ : |
| 19 | \\ : [number] "{g1}" (4), |
| 20 | \\ [arg1] "{o0}" (1), |
| 21 | \\ [arg2] "{o1}" (@ptrToInt(msg)), |
| 22 | \\ [arg3] "{o2}" (msg.len) |
| 23 | \\ : "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", "memory" |
| 24 | \\ ); |
| 25 | \\ |
| 26 | \\ asm volatile ("ta 0x6d" |
| 27 | \\ : |
| 28 | \\ : [number] "{g1}" (1), |
| 29 | \\ [arg1] "{o0}" (0) |
| 30 | \\ : "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", "memory" |
| 31 | \\ ); |
| 32 | \\ |
| 33 | \\ unreachable; |
| 34 | \\} |
| 35 | , |
| 36 | "Hello, World!\n", |
| 37 | ); |
| 38 | } |
| 39 | } |