| 1 | const std = @import("std"); |
| 2 | |
| 3 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { |
| 4 | _ = stack_trace; |
| 5 | if (std.mem.eql(u8, message, "attempt to load uninstantiable type")) { |
| 6 | std.process.exit(0); |
| 7 | } |
| 8 | std.process.exit(1); |
| 9 | } |
| 10 | |
| 11 | const E = enum {}; |
| 12 | pub fn main() error{TestFailed}!void { |
| 13 | const bytes: [32]u8 = @splat(0); |
| 14 | const ptr: *const E = @ptrCast(&bytes); |
| 15 | _ = ptr.*; |
| 16 | return error.TestFailed; |
| 17 | } |
| 18 | // run |
| 19 | // backend=selfhosted,llvm |
| 20 | // target=x86_64-linux,aarch64-linux,wasm32-wasi |