mirror of
https://github.com/ziglang/zig.git
synced 2025-12-14 02:03:08 +00:00
18 lines
667 B
Zig
18 lines
667 B
Zig
const io = @import("std").io;
|
|
const builtin = @import("builtin");
|
|
|
|
pub fn write(_: void, bytes: []const u8) !usize {
|
|
_ = bytes;
|
|
return 0;
|
|
}
|
|
pub fn writer() io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_type.?).ErrorUnion.error_set, write) {
|
|
return io.Writer(void, @typeInfo(@typeInfo(@TypeOf(write)).Fn.return_type.?).ErrorUnion.error_set, write){ .context = {} };
|
|
}
|
|
|
|
test "crash" {
|
|
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
|
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
|
|
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
|
_ = io.multiWriter(.{writer()});
|
|
}
|