add regression test for already fixed bug

closes #3112
This commit is contained in:
Andrew Kelley 2019-08-27 17:39:06 -04:00
parent f4519c520a
commit 47fcbfdc51
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
2 changed files with 18 additions and 0 deletions

View File

@ -30,6 +30,7 @@ comptime {
_ = @import("behavior/bugs/2114.zig");
_ = @import("behavior/bugs/2346.zig");
_ = @import("behavior/bugs/2578.zig");
_ = @import("behavior/bugs/3112.zig");
_ = @import("behavior/bugs/394.zig");
_ = @import("behavior/bugs/421.zig");
_ = @import("behavior/bugs/529.zig");

View File

@ -0,0 +1,17 @@
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);
}