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, "index out of bounds: index 4, len 4")) {
6 std.process.exit(0);
7 }
8 std.process.exit(1);
9}
10pub fn main() !void {
11 const a = [_]i32{ 1, 2, 3, 4 };
12 baz(bar(&a));
13 return error.TestFailed;
14}
15fn bar(a: []const i32) i32 {
16 return a[4];
17}
18fn baz(_: i32) void {}
19// run
20// backend=selfhosted,llvm
21// target=x86_64-linux,aarch64-linux