| ... | ... | @@ -23,6 +23,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 23 | 23 | |
| 24 | 24 | // Now change the message only |
| 25 | 25 | // TODO fix C backend not supporting updates |
| 26 | // https://github.com/ziglang/zig/issues/7589 |
| 26 | 27 | //case.addCompareOutput( |
| 27 | 28 | // \\extern fn puts(s: [*:0]const u8) c_int; |
| 28 | 29 | // \\export fn main() c_int { |
| ... | ... | @@ -88,9 +89,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 88 | 89 | , |
| 89 | 90 | \\zig_noreturn void exitGood(void); |
| 90 | 91 | \\ |
| 91 | | \\const char *const exitGood__anon_0 = "{rax}"; |
| 92 | | \\const char *const exitGood__anon_1 = "{rdi}"; |
| 93 | | \\const char *const exitGood__anon_2 = "syscall"; |
| 92 | \\static uint8_t exitGood__anon_0[6] = "{rax}"; |
| 93 | \\static uint8_t exitGood__anon_1[6] = "{rdi}"; |
| 94 | \\static uint8_t exitGood__anon_2[8] = "syscall"; |
| 94 | 95 | \\ |
| 95 | 96 | \\zig_noreturn void _start(void) { |
| 96 | 97 | \\ exitGood(); |
| ... | ... | @@ -122,9 +123,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 122 | 123 | , |
| 123 | 124 | \\zig_noreturn void exit(uintptr_t arg0); |
| 124 | 125 | \\ |
| 125 | | \\const char *const exit__anon_0 = "{rax}"; |
| 126 | | \\const char *const exit__anon_1 = "{rdi}"; |
| 127 | | \\const char *const exit__anon_2 = "syscall"; |
| 126 | \\static uint8_t exit__anon_0[6] = "{rax}"; |
| 127 | \\static uint8_t exit__anon_1[6] = "{rdi}"; |
| 128 | \\static uint8_t exit__anon_2[8] = "syscall"; |
| 128 | 129 | \\ |
| 129 | 130 | \\zig_noreturn void _start(void) { |
| 130 | 131 | \\ exit(0); |
| ... | ... | @@ -154,13 +155,11 @@ pub fn addCases(ctx: *TestContext) !void { |
| 154 | 155 | \\} |
| 155 | 156 | \\ |
| 156 | 157 | , |
| 157 | | \\#include <stdint.h> |
| 158 | | \\ |
| 159 | 158 | \\zig_noreturn void exit(uint8_t arg0); |
| 160 | 159 | \\ |
| 161 | | \\const char *const exit__anon_0 = "{rax}"; |
| 162 | | \\const char *const exit__anon_1 = "{rdi}"; |
| 163 | | \\const char *const exit__anon_2 = "syscall"; |
| 160 | \\static uint8_t exit__anon_0[6] = "{rax}"; |
| 161 | \\static uint8_t exit__anon_1[6] = "{rdi}"; |
| 162 | \\static uint8_t exit__anon_2[8] = "syscall"; |
| 164 | 163 | \\ |
| 165 | 164 | \\zig_noreturn void _start(void) { |
| 166 | 165 | \\ exit(0); |
| ... | ... | @@ -195,14 +194,12 @@ pub fn addCases(ctx: *TestContext) !void { |
| 195 | 194 | \\} |
| 196 | 195 | \\ |
| 197 | 196 | , |
| 198 | | \\#include <stdint.h> |
| 199 | | \\ |
| 200 | 197 | \\zig_noreturn void exitMath(uint8_t arg0); |
| 201 | 198 | \\zig_noreturn void exit(uint8_t arg0); |
| 202 | 199 | \\ |
| 203 | | \\const char *const exit__anon_0 = "{rax}"; |
| 204 | | \\const char *const exit__anon_1 = "{rdi}"; |
| 205 | | \\const char *const exit__anon_2 = "syscall"; |
| 200 | \\static uint8_t exit__anon_0[6] = "{rax}"; |
| 201 | \\static uint8_t exit__anon_1[6] = "{rdi}"; |
| 202 | \\static uint8_t exit__anon_2[8] = "syscall"; |
| 206 | 203 | \\ |
| 207 | 204 | \\zig_noreturn void _start(void) { |
| 208 | 205 | \\ exitMath(1); |
| ... | ... | @@ -243,14 +240,12 @@ pub fn addCases(ctx: *TestContext) !void { |
| 243 | 240 | \\} |
| 244 | 241 | \\ |
| 245 | 242 | , |
| 246 | | \\#include <stdint.h> |
| 247 | | \\ |
| 248 | 243 | \\zig_noreturn void exitMath(uint8_t arg0); |
| 249 | 244 | \\zig_noreturn void exit(uint8_t arg0); |
| 250 | 245 | \\ |
| 251 | | \\const char *const exit__anon_0 = "{rax}"; |
| 252 | | \\const char *const exit__anon_1 = "{rdi}"; |
| 253 | | \\const char *const exit__anon_2 = "syscall"; |
| 246 | \\static uint8_t exit__anon_0[6] = "{rax}"; |
| 247 | \\static uint8_t exit__anon_1[6] = "{rdi}"; |
| 248 | \\static uint8_t exit__anon_2[8] = "syscall"; |
| 254 | 249 | \\ |
| 255 | 250 | \\zig_noreturn void _start(void) { |
| 256 | 251 | \\ exitMath(1); |
| ... | ... | @@ -275,24 +270,18 @@ pub fn addCases(ctx: *TestContext) !void { |
| 275 | 270 | ctx.h("header with single param function", linux_x64, |
| 276 | 271 | \\export fn start(a: u8) void{} |
| 277 | 272 | , |
| 278 | | \\#include <stdint.h> |
| 279 | | \\ |
| 280 | 273 | \\void start(uint8_t arg0); |
| 281 | 274 | \\ |
| 282 | 275 | ); |
| 283 | 276 | ctx.h("header with multiple param function", linux_x64, |
| 284 | 277 | \\export fn start(a: u8, b: u8, c: u8) void{} |
| 285 | 278 | , |
| 286 | | \\#include <stdint.h> |
| 287 | | \\ |
| 288 | 279 | \\void start(uint8_t arg0, uint8_t arg1, uint8_t arg2); |
| 289 | 280 | \\ |
| 290 | 281 | ); |
| 291 | 282 | ctx.h("header with u32 param function", linux_x64, |
| 292 | 283 | \\export fn start(a: u32) void{} |
| 293 | 284 | , |
| 294 | | \\#include <stdint.h> |
| 295 | | \\ |
| 296 | 285 | \\void start(uint32_t arg0); |
| 297 | 286 | \\ |
| 298 | 287 | ); |
| ... | ... | @@ -329,8 +318,6 @@ pub fn addCases(ctx: *TestContext) !void { |
| 329 | 318 | ctx.h("header with multiple includes", linux_x64, |
| 330 | 319 | \\export fn start(a: u32, b: usize) void{} |
| 331 | 320 | , |
| 332 | | \\#include <stdint.h> |
| 333 | | \\ |
| 334 | 321 | \\void start(uint32_t arg0, uintptr_t arg1); |
| 335 | 322 | \\ |
| 336 | 323 | ); |