diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-09 10:43:29 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-09 10:44:06 -0400 |
| commit | 9eb51e20ed1a040a617541303db760f80ffd3aa1 (patch) | |
| tree | a85f682a1d27f889d1c106188c2e2406c1026f2a /test/compile_errors.zig | |
| parent | 42ba06133aec995feec3ea24ee7fbbc40d7ac2ca (diff) | |
| download | zig-9eb51e20ed1a040a617541303db760f80ffd3aa1.tar.gz zig-9eb51e20ed1a040a617541303db760f80ffd3aa1.zip | |
fix crash on @ptrToInt of a *void
closes #1192
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 9071f0ad7e..4ed65e449d 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,15 @@ const tests = @import("tests.zig"); pub fn addCases(cases: *tests.CompileErrorContext) void { cases.add( + "@ptrToInt on *void", + \\export fn entry() bool { + \\ return @ptrToInt(&{}) == @ptrToInt(&{}); + \\} + , + ".tmp_source.zig:2:23: error: pointer to size 0 type has no address", + ); + + cases.add( "@popCount - non-integer", \\export fn entry(x: f32) u32 { \\ return @popCount(x); |
