| ... | @@ -15,6 +15,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -15,6 +15,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 15 | \\} | 15 | \\} |
| 16 | , | 16 | , |
| 17 | \\zig_noreturn void _start(void) { | 17 | \\zig_noreturn void _start(void) { |
| | 18 | \\ zig_breakpoint(); |
| 18 | \\ zig_unreachable(); | 19 | \\ zig_unreachable(); |
| 19 | \\} | 20 | \\} |
| 20 | \\ | 21 | \\ |
| ... | @@ -41,6 +42,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -41,6 +42,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 41 | \\} | 42 | \\} |
| 42 | \\ | 43 | \\ |
| 43 | \\zig_noreturn void main(void) { | 44 | \\zig_noreturn void main(void) { |
| | 45 | \\ zig_breakpoint(); |
| 44 | \\ zig_unreachable(); | 46 | \\ zig_unreachable(); |
| 45 | \\} | 47 | \\} |
| 46 | \\ | 48 | \\ |
| ... | @@ -61,8 +63,6 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -61,8 +63,6 @@ pub fn addCases(ctx: *TestContext) !void { |
| 61 | \\ exitGood(); | 63 | \\ exitGood(); |
| 62 | \\} | 64 | \\} |
| 63 | , | 65 | , |
| 64 | \\#include <stddef.h> | | |
| 65 | \\ | | |
| 66 | \\zig_noreturn void exitGood(void); | 66 | \\zig_noreturn void exitGood(void); |
| 67 | \\ | 67 | \\ |
| 68 | \\const char *const exitGood__anon_0 = "{rax}"; | 68 | \\const char *const exitGood__anon_0 = "{rax}"; |
| ... | @@ -74,9 +74,10 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -74,9 +74,10 @@ pub fn addCases(ctx: *TestContext) !void { |
| 74 | \\} | 74 | \\} |
| 75 | \\ | 75 | \\ |
| 76 | \\zig_noreturn void exitGood(void) { | 76 | \\zig_noreturn void exitGood(void) { |
| 77 | \\ register size_t rax_constant __asm__("rax") = 231; | 77 | \\ register uintptr_t rax_constant __asm__("rax") = 231; |
| 78 | \\ register size_t rdi_constant __asm__("rdi") = 0; | 78 | \\ register uintptr_t rdi_constant __asm__("rdi") = 0; |
| 79 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); | 79 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| | 80 | \\ zig_breakpoint(); |
| 80 | \\ zig_unreachable(); | 81 | \\ zig_unreachable(); |
| 81 | \\} | 82 | \\} |
| 82 | \\ | 83 | \\ |
| ... | @@ -96,9 +97,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -96,9 +97,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 96 | \\} | 97 | \\} |
| 97 | \\ | 98 | \\ |
| 98 | , | 99 | , |
| 99 | \\#include <stddef.h> | 100 | \\zig_noreturn void exit(uintptr_t arg0); |
| 100 | \\ | | |
| 101 | \\zig_noreturn void exit(size_t arg0); | | |
| 102 | \\ | 101 | \\ |
| 103 | \\const char *const exit__anon_0 = "{rax}"; | 102 | \\const char *const exit__anon_0 = "{rax}"; |
| 104 | \\const char *const exit__anon_1 = "{rdi}"; | 103 | \\const char *const exit__anon_1 = "{rdi}"; |
| ... | @@ -108,10 +107,11 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -108,10 +107,11 @@ pub fn addCases(ctx: *TestContext) !void { |
| 108 | \\ exit(0); | 107 | \\ exit(0); |
| 109 | \\} | 108 | \\} |
| 110 | \\ | 109 | \\ |
| 111 | \\zig_noreturn void exit(size_t arg0) { | 110 | \\zig_noreturn void exit(uintptr_t arg0) { |
| 112 | \\ register size_t rax_constant __asm__("rax") = 231; | 111 | \\ register uintptr_t rax_constant __asm__("rax") = 231; |
| 113 | \\ register size_t rdi_constant __asm__("rdi") = arg0; | 112 | \\ register uintptr_t rdi_constant __asm__("rdi") = arg0; |
| 114 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); | 113 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| | 114 | \\ zig_breakpoint(); |
| 115 | \\ zig_unreachable(); | 115 | \\ zig_unreachable(); |
| 116 | \\} | 116 | \\} |
| 117 | \\ | 117 | \\ |
| ... | @@ -131,7 +131,6 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -131,7 +131,6 @@ pub fn addCases(ctx: *TestContext) !void { |
| 131 | \\} | 131 | \\} |
| 132 | \\ | 132 | \\ |
| 133 | , | 133 | , |
| 134 | \\#include <stddef.h> | | |
| 135 | \\#include <stdint.h> | 134 | \\#include <stdint.h> |
| 136 | \\ | 135 | \\ |
| 137 | \\zig_noreturn void exit(uint8_t arg0); | 136 | \\zig_noreturn void exit(uint8_t arg0); |
| ... | @@ -145,10 +144,11 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -145,10 +144,11 @@ pub fn addCases(ctx: *TestContext) !void { |
| 145 | \\} | 144 | \\} |
| 146 | \\ | 145 | \\ |
| 147 | \\zig_noreturn void exit(uint8_t arg0) { | 146 | \\zig_noreturn void exit(uint8_t arg0) { |
| 148 | \\ const size_t __temp_0 = (size_t)arg0; | 147 | \\ const uintptr_t __temp_0 = (uintptr_t)arg0; |
| 149 | \\ register size_t rax_constant __asm__("rax") = 231; | 148 | \\ register uintptr_t rax_constant __asm__("rax") = 231; |
| 150 | \\ register size_t rdi_constant __asm__("rdi") = __temp_0; | 149 | \\ register uintptr_t rdi_constant __asm__("rdi") = __temp_0; |
| 151 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); | 150 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| | 151 | \\ zig_breakpoint(); |
| 152 | \\ zig_unreachable(); | 152 | \\ zig_unreachable(); |
| 153 | \\} | 153 | \\} |
| 154 | \\ | 154 | \\ |
| ... | @@ -172,7 +172,6 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -172,7 +172,6 @@ pub fn addCases(ctx: *TestContext) !void { |
| 172 | \\} | 172 | \\} |
| 173 | \\ | 173 | \\ |
| 174 | , | 174 | , |
| 175 | \\#include <stddef.h> | | |
| 176 | \\#include <stdint.h> | 175 | \\#include <stdint.h> |
| 177 | \\ | 176 | \\ |
| 178 | \\zig_noreturn void exitMath(uint8_t arg0); | 177 | \\zig_noreturn void exitMath(uint8_t arg0); |
| ... | @@ -193,10 +192,11 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -193,10 +192,11 @@ pub fn addCases(ctx: *TestContext) !void { |
| 193 | \\} | 192 | \\} |
| 194 | \\ | 193 | \\ |
| 195 | \\zig_noreturn void exit(uint8_t arg0) { | 194 | \\zig_noreturn void exit(uint8_t arg0) { |
| 196 | \\ const size_t __temp_0 = (size_t)arg0; | 195 | \\ const uintptr_t __temp_0 = (uintptr_t)arg0; |
| 197 | \\ register size_t rax_constant __asm__("rax") = 231; | 196 | \\ register uintptr_t rax_constant __asm__("rax") = 231; |
| 198 | \\ register size_t rdi_constant __asm__("rdi") = __temp_0; | 197 | \\ register uintptr_t rdi_constant __asm__("rdi") = __temp_0; |
| 199 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); | 198 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| | 199 | \\ zig_breakpoint(); |
| 200 | \\ zig_unreachable(); | 200 | \\ zig_unreachable(); |
| 201 | \\} | 201 | \\} |
| 202 | \\ | 202 | \\ |
| ... | @@ -220,7 +220,6 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -220,7 +220,6 @@ pub fn addCases(ctx: *TestContext) !void { |
| 220 | \\} | 220 | \\} |
| 221 | \\ | 221 | \\ |
| 222 | , | 222 | , |
| 223 | \\#include <stddef.h> | | |
| 224 | \\#include <stdint.h> | 223 | \\#include <stdint.h> |
| 225 | \\ | 224 | \\ |
| 226 | \\zig_noreturn void exitMath(uint8_t arg0); | 225 | \\zig_noreturn void exitMath(uint8_t arg0); |
| ... | @@ -241,10 +240,11 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -241,10 +240,11 @@ pub fn addCases(ctx: *TestContext) !void { |
| 241 | \\} | 240 | \\} |
| 242 | \\ | 241 | \\ |
| 243 | \\zig_noreturn void exit(uint8_t arg0) { | 242 | \\zig_noreturn void exit(uint8_t arg0) { |
| 244 | \\ const size_t __temp_0 = (size_t)arg0; | 243 | \\ const uintptr_t __temp_0 = (uintptr_t)arg0; |
| 245 | \\ register size_t rax_constant __asm__("rax") = 231; | 244 | \\ register uintptr_t rax_constant __asm__("rax") = 231; |
| 246 | \\ register size_t rdi_constant __asm__("rdi") = __temp_0; | 245 | \\ register uintptr_t rdi_constant __asm__("rdi") = __temp_0; |
| 247 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); | 246 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| | 247 | \\ zig_breakpoint(); |
| 248 | \\ zig_unreachable(); | 248 | \\ zig_unreachable(); |
| 249 | \\} | 249 | \\} |
| 250 | \\ | 250 | \\ |
| ... | @@ -276,9 +276,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -276,9 +276,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 276 | ctx.h("header with usize param function", linux_x64, | 276 | ctx.h("header with usize param function", linux_x64, |
| 277 | \\export fn start(a: usize) void{} | 277 | \\export fn start(a: usize) void{} |
| 278 | , | 278 | , |
| 279 | \\#include <stddef.h> | 279 | \\void start(uintptr_t arg0); |
| 280 | \\ | | |
| 281 | \\void start(size_t arg0); | | |
| 282 | \\ | 280 | \\ |
| 283 | ); | 281 | ); |
| 284 | ctx.h("header with bool param function", linux_x64, | 282 | ctx.h("header with bool param function", linux_x64, |
| ... | @@ -308,10 +306,9 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -308,10 +306,9 @@ pub fn addCases(ctx: *TestContext) !void { |
| 308 | ctx.h("header with multiple includes", linux_x64, | 306 | ctx.h("header with multiple includes", linux_x64, |
| 309 | \\export fn start(a: u32, b: usize) void{} | 307 | \\export fn start(a: u32, b: usize) void{} |
| 310 | , | 308 | , |
| 311 | \\#include <stddef.h> | | |
| 312 | \\#include <stdint.h> | 309 | \\#include <stdint.h> |
| 313 | \\ | 310 | \\ |
| 314 | \\void start(uint32_t arg0, size_t arg1); | 311 | \\void start(uint32_t arg0, uintptr_t arg1); |
| 315 | \\ | 312 | \\ |
| 316 | ); | 313 | ); |
| 317 | } | 314 | } |