aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-07-09 10:43:29 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-07-09 10:44:06 -0400
commit9eb51e20ed1a040a617541303db760f80ffd3aa1 (patch)
treea85f682a1d27f889d1c106188c2e2406c1026f2a /test/compile_errors.zig
parent42ba06133aec995feec3ea24ee7fbbc40d7ac2ca (diff)
downloadzig-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.zig9
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);