aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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);
+}