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