| 1 | const std = @import("std"); |
| 2 | pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn { |
| 3 | _ = stack_trace; |
| 4 | if (std.mem.eql(u8, message, "integer part of floating point value out of bounds")) { |
| 5 | std.process.exit(0); |
| 6 | } |
| 7 | std.process.exit(1); |
| 8 | } |
| 9 | var x: f32 = 1.0; |
| 10 | pub fn main() !void { |
| 11 | _ = @as(u0, @intFromFloat(x)); |
| 12 | return error.TestFailed; |
| 13 | } |
| 14 | // run |
| 15 | // backend=selfhosted,llvm |
| 16 | // target=x86_64-linux,aarch64-linux,wasm32-wasi |