Commit 7504be923b

Andrew Kelley <superjoe30@gmail.com>
2016-12-26 21:49:03
IR: pass pointerComparison test
1 parent 735cdbf
Changed files (2)
test/cases/misc.zig
@@ -424,6 +424,16 @@ fn intToPtrCast() {
 }
 
 
+fn pointerComparison() {
+    @setFnTest(this);
+
+    const a = ([]u8)("a");
+    const b = &a;
+    assert(ptrEql(b, b));
+}
+fn ptrEql(a: &[]const u8, b: &[]const u8) -> bool {
+    a == b
+}
 
 
 // TODO import from std.str
test/self_hosted.zig
@@ -38,18 +38,6 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize {
 }
 
 
-// TODO not passing
-fn pointerComparison() {
-    @setFnTest(this, true);
-
-    const a = ([]u8)("a");
-    const b = &a;
-    assert(ptrEql(b, b));
-}
-fn ptrEql(a: &[]u8, b: &[]u8) -> bool {
-    a == b
-}
-
 // TODO change this test to an issue
 // we're going to change how this works
 fn switchOnErrorUnion() {