diff options
Diffstat (limited to 'test/compile_errors.zig')
| -rw-r--r-- | test/compile_errors.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig index a193095b0f..edfb73fc42 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -3,6 +3,15 @@ const builtin = @import("builtin"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "@ptrToInt 0 to non optional pointer", + \\export fn entry() void { + \\ var b = @intToPtr(*i32, 0); + \\} + , + "tmp.zig:2:13: error: pointer type '*i32' does not allow address zero", + ); + + cases.add( "cast enum literal to enum but it doesn't match", \\const Foo = enum { \\ a, |
