master
1const std = @import("std");
2
3pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
4 _ = stack_trace;
5 if (std.mem.eql(u8, message, "integer does not fit in destination type")) {
6 std.process.exit(0);
7 }
8 std.process.exit(1);
9}
10
11pub fn main() !void {
12 const x = shorten_cast(200);
13 if (x == 0) return error.Whatever;
14 return error.TestFailed;
15}
16fn shorten_cast(x: i32) i8 {
17 return @intCast(x);
18}
19// run
20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux