summaryrefslogtreecommitdiff
path: root/test/ptrcmp.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-08-19 17:06:58 -0400
committerOri Bernstein <ori@eigenstate.org>2014-08-19 17:06:58 -0400
commit0ed042f0cfb35372cada674f8a5e878b0768a8f0 (patch)
tree5b6df4a5fb5a8f254bac56fb21724d5b8db8f8d1 /test/ptrcmp.myr
parent9afc669ebe308816f556c87355276ba1b2ec6665 (diff)
downloadmc-0ed042f0cfb35372cada674f8a5e878b0768a8f0.tar.gz
Fix pointer comparisons, and add a test for it.
Diffstat (limited to 'test/ptrcmp.myr')
-rw-r--r--test/ptrcmp.myr13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ptrcmp.myr b/test/ptrcmp.myr
new file mode 100644
index 0000000..ec47c2b
--- /dev/null
+++ b/test/ptrcmp.myr
@@ -0,0 +1,13 @@
+use std
+
+const main = {
+ var a, b, v1, v2
+
+ v1 = 42
+ v2 = 42
+ a = &v1
+ b = &v1
+ std.assert(a == b, "pointers should be equal, but weren't\n")
+ std.assert(a != b, "pointers weren't equal, but should be\n")
+ std.exit(0)
+}