zig/test/behavior/bugs/3112.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

18 lines
317 B
Zig

const std = @import("std");
const expect = std.testing.expect;
const State = struct {
const Self = @This();
enter: fn (previous: ?Self) void,
};
fn prev(p: ?State) void {
expect(p == null);
}
test "zig test crash" {
var global: State = undefined;
global.enter = prev;
global.enter(null);
}