| 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 U = union { |
| 12 | foo: struct { a: u8, b: noreturn, }, |
| 13 | bar: enum {}, |
| 14 | }; |
| 15 | pub fn main() error{TestFailed}!void { |
| 16 | const bytes: [32]u8 = @splat(0); |
| 17 | const ptr: *const U = @ptrCast(&bytes); |
| 18 | _ = ptr.*; |
| 19 | return error.TestFailed; |
| 20 | } |
| 21 | // run |
| 22 | // backend=selfhosted,llvm |
| 23 | // target=x86_64-linux,aarch64-linux,wasm32-wasi |