2022-05-13 08:00:20 +01:00
|
|
|
const std = @import("std");
|
|
|
|
|
2022-09-14 22:43:48 +01:00
|
|
|
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace, _: ?usize) noreturn {
|
2022-05-13 08:00:20 +01:00
|
|
|
_ = stack_trace;
|
2022-08-08 07:10:57 +01:00
|
|
|
if (std.mem.eql(u8, message, "index out of bounds: index 5, len 4")) {
|
2022-05-13 08:00:20 +01:00
|
|
|
std.process.exit(0);
|
|
|
|
}
|
|
|
|
std.process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() !void {
|
|
|
|
var buf = [4]u8{ 'a', 'b', 'c', 0 };
|
|
|
|
const input: []u8 = &buf;
|
|
|
|
const slice = input[0..4 :0];
|
|
|
|
_ = slice;
|
|
|
|
return error.TestFailed;
|
|
|
|
}
|
|
|
|
|
|
|
|
// run
|
2022-08-05 15:08:31 +01:00
|
|
|
// backend=llvm
|
2022-05-14 01:58:32 +01:00
|
|
|
// target=native
|