| ... | @@ -186,6 +186,38 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -186,6 +186,38 @@ pub fn addCases(ctx: *TestContext) !void { |
| 186 | , | 186 | , |
| 187 | "Hello, World!\n", | 187 | "Hello, World!\n", |
| 188 | ); | 188 | ); |
| | 189 | // Now change the message only |
| | 190 | case.addCompareOutput( |
| | 191 | \\export fn _start() noreturn { |
| | 192 | \\ print(); |
| | 193 | \\ |
| | 194 | \\ exit(); |
| | 195 | \\} |
| | 196 | \\ |
| | 197 | \\fn print() void { |
| | 198 | \\ asm volatile ("syscall" |
| | 199 | \\ : |
| | 200 | \\ : [number] "{rax}" (0x2000004), |
| | 201 | \\ [arg1] "{rdi}" (1), |
| | 202 | \\ [arg2] "{rsi}" (@ptrToInt("What is up? This is a longer message that will force the data to be relocated in virtual address space.\n")), |
| | 203 | \\ [arg3] "{rdx}" (104) |
| | 204 | \\ : "memory" |
| | 205 | \\ ); |
| | 206 | \\ return; |
| | 207 | \\} |
| | 208 | \\ |
| | 209 | \\fn exit() noreturn { |
| | 210 | \\ asm volatile ("syscall" |
| | 211 | \\ : |
| | 212 | \\ : [number] "{rax}" (0x2000001), |
| | 213 | \\ [arg1] "{rdi}" (0) |
| | 214 | \\ : "memory" |
| | 215 | \\ ); |
| | 216 | \\ unreachable; |
| | 217 | \\} |
| | 218 | , |
| | 219 | "What is up? This is a longer message that will force the data to be relocated in virtual address space.\n", |
| | 220 | ); |
| 189 | } | 221 | } |
| 190 | | 222 | |
| 191 | { | 223 | { |