add codegen for pointer comparison

see #145
This commit is contained in:
Andrew Kelley
2016-04-24 12:27:59 -07:00
parent 8ad75a9bf3
commit 8583fd7f9f
2 changed files with 14 additions and 1 deletions

View File

@@ -1480,7 +1480,9 @@ static LLVMValueRef gen_cmp_expr(CodeGen *g, AstNode *node) {
} else {
zig_unreachable();
}
} else if (op1_type->id == TypeTableEntryIdPureError) {
} else if (op1_type->id == TypeTableEntryIdPureError ||
op1_type->id == TypeTableEntryIdPointer)
{
LLVMIntPredicate pred = cmp_op_to_int_predicate(node->data.bin_op_expr.bin_op, false);
return LLVMBuildICmp(g->builder, pred, val1, val2, "");
} else {