ability to compare booleans

This commit is contained in:
Andrew Kelley
2016-04-26 11:39:31 -07:00
parent d1fa5692c6
commit 8ec109de3c
2 changed files with 10 additions and 1 deletions

View File

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