authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-26 15:49:03-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-26 15:49:03-05:00
log7504be923b1721a5a5e094a306aad029887270e8
treecd678f8774e42291ae128e5809b2f46342745cb6
parent735cdbfdaca6405d1465ea859032412499c658d8

IR: pass pointerComparison test


2 files changed, 10 insertions(+), 12 deletions(-)

test/cases/misc.zig+10
......@@ -424,6 +424,16 @@ fn intToPtrCast() {
424424}
425425
426426
427fn pointerComparison() {
428 @setFnTest(this);
429
430 const a = ([]u8)("a");
431 const b = &a;
432 assert(ptrEql(b, b));
433}
434fn ptrEql(a: &[]const u8, b: &[]const u8) -> bool {
435 a == b
436}
427437
428438
429439// TODO import from std.str
test/self_hosted.zig-12
......@@ -38,18 +38,6 @@ fn testPassSliceOfEmptyStructToFn(slice: []EmptyStruct2) -> usize {
3838}
3939
4040
41// TODO not passing
42fn pointerComparison() {
43 @setFnTest(this, true);
44
45 const a = ([]u8)("a");
46 const b = &a;
47 assert(ptrEql(b, b));
48}
49fn ptrEql(a: &[]u8, b: &[]u8) -> bool {
50 a == b
51}
52
5341// TODO change this test to an issue
5442// we're going to change how this works
5543fn switchOnErrorUnion() {