aboutsummaryrefslogtreecommitdiff
path: root/test/stage1/behavior
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-03-23 18:46:20 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-03-23 18:48:12 -0400
commit4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a (patch)
tree57890fd7b757fd39103327ffd05d1f4352d21128 /test/stage1/behavior
parent89953ec83d8afe4fed0fc9e3cdded09c7522bf86 (diff)
downloadzig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.tar.gz
zig-4d50bc3f8dd2b9fd5b7dde6f63f104aaba6dbf5a.zip
add peer type resolution for `*const T` and `?*T`
closes #1298
Diffstat (limited to 'test/stage1/behavior')
-rw-r--r--test/stage1/behavior/pointers.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/stage1/behavior/pointers.zig b/test/stage1/behavior/pointers.zig
index 1bb23866b4..5b73cd98df 100644
--- a/test/stage1/behavior/pointers.zig
+++ b/test/stage1/behavior/pointers.zig
@@ -130,3 +130,10 @@ test "initialize const optional C pointer to null" {
expect(a == null);
comptime expect(a == null);
}
+
+test "compare equality of optional and non-optional pointer" {
+ const a = @intToPtr(*const usize, 0x123456789);
+ const b = @intToPtr(?*usize, 0x123456789);
+ expect(a == b);
+ expect(b == a);
+}