mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 14:28:57 +00:00
parent
7c99c30bf4
commit
55193cb13b
@ -2246,12 +2246,12 @@ static LLVMValueRef ir_render_bin_op(CodeGen *g, IrExecutable *executable,
|
||||
} else if (type_entry->id == TypeTableEntryIdInt) {
|
||||
LLVMIntPredicate pred = cmp_op_to_int_predicate(op_id, type_entry->data.integral.is_signed);
|
||||
return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, "");
|
||||
} else if (type_entry->id == TypeTableEntryIdEnum) {
|
||||
LLVMIntPredicate pred = cmp_op_to_int_predicate(op_id, false);
|
||||
return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, "");
|
||||
} else if (type_entry->id == TypeTableEntryIdErrorSet ||
|
||||
} else if (type_entry->id == TypeTableEntryIdEnum ||
|
||||
type_entry->id == TypeTableEntryIdErrorSet ||
|
||||
type_entry->id == TypeTableEntryIdPointer ||
|
||||
type_entry->id == TypeTableEntryIdBool)
|
||||
type_entry->id == TypeTableEntryIdBool ||
|
||||
type_entry->id == TypeTableEntryIdPromise ||
|
||||
type_entry->id == TypeTableEntryIdFn)
|
||||
{
|
||||
LLVMIntPredicate pred = cmp_op_to_int_predicate(op_id, false);
|
||||
return LLVMBuildICmp(g->builder, pred, op1_value, op2_value, "");
|
||||
|
||||
@ -701,3 +701,8 @@ test "comptime cast fn to ptr" {
|
||||
const addr2 = @ptrCast(*const u8, emptyFn);
|
||||
comptime assert(addr1 == addr2);
|
||||
}
|
||||
|
||||
test "equality compare fn ptrs" {
|
||||
var a = emptyFn;
|
||||
assert(a == a);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user