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-05 15:36:45 +01:00
|
|
|
if (std.mem.eql(u8, message, "cast causes pointer to be null")) {
|
|
|
|
std.process.exit(0);
|
|
|
|
}
|
|
|
|
std.process.exit(1);
|
2022-05-13 08:00:20 +01:00
|
|
|
}
|
2022-08-05 15:36:45 +01:00
|
|
|
|
2022-05-13 08:00:20 +01:00
|
|
|
pub fn main() !void {
|
|
|
|
var c_ptr: [*c]u8 = 0;
|
|
|
|
var zig_ptr: *u8 = c_ptr;
|
|
|
|
_ = zig_ptr;
|
|
|
|
return error.TestFailed;
|
|
|
|
}
|
2022-08-05 15:36:45 +01:00
|
|
|
|
2022-05-13 08:00:20 +01:00
|
|
|
// run
|
2022-08-05 15:36:45 +01:00
|
|
|
// backend=llvm
|
2022-05-14 01:58:32 +01:00
|
|
|
// target=native
|