| author | |
| committer | |
| log | 78fe86dcd23821b6a40bc5a0067513c452e50265 |
| tree | 6378572036de9e1880e55bec8ce23bc4a255595b |
| parent | d3eec7d46b1dea6c99dd4beea370a3629843c111 |
3 files changed, 8 insertions(+), 2 deletions(-)
src-self-hosted/cbe.h+5| ... | ... | @@ -8,3 +8,8 @@ |
| 8 | 8 | #define zig_noreturn |
| 9 | 9 | #endif |
| 10 | 10 | |
| 11 | #if __GNUC__ | |
| 12 | #define zig_unreachable() __builtin_unreachable() | |
| 13 | #else | |
| 14 | #define zig_unreachable() | |
| 15 | #endif |
src-self-hosted/codegen/c.zig+1-1| ... | ... | @@ -178,7 +178,7 @@ fn genBreak(file: *C, inst: *Inst.NoOp, decl: *Decl) !void { |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | fn genUnreach(file: *C, inst: *Inst.NoOp, decl: *Decl) !void { |
| 181 | // TODO ?? | |
| 181 | try file.main.writer().writeAll(" zig_unreachable();\n"); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | fn genAsm(file: *C, as: *Inst.Assembly, decl: *Decl, argdex: *usize) !void { |
test/stage2/cbe.zig+2-1| ... | ... | @@ -65,7 +65,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 65 | 65 | \\} |
| 66 | 66 | \\ |
| 67 | 67 | ); |
| 68 | ctx.c("exit", linux_x64, | |
| 68 | ctx.c("exit with parameter", linux_x64, | |
| 69 | 69 | \\export fn _start() noreturn { |
| 70 | 70 | \\ exit(0); |
| 71 | 71 | \\} |
| ... | ... | @@ -96,6 +96,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 96 | 96 | \\ register size_t rax_constant __asm__("rax") = 231; |
| 97 | 97 | \\ register size_t rdi_constant __asm__("rdi") = arg0; |
| 98 | 98 | \\ __asm volatile ("syscall" :: ""(rax_constant), ""(rdi_constant)); |
| 99 | \\ zig_unreachable(); | |
| 99 | 100 | \\} |
| 100 | 101 | \\ |
| 101 | 102 | ); |