mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Bump to 0.3.7. Fixes issue with bitoperations on booleans.
This commit is contained in:
@@ -3277,6 +3277,11 @@ void gencontext_emit_binary(GenContext *c, BEValue *be_value, Expr *expr, BEValu
|
||||
UNREACHABLE
|
||||
}
|
||||
assert(val);
|
||||
if (lhs.type == type_bool)
|
||||
{
|
||||
llvm_value_set_bool(be_value, val);
|
||||
return;
|
||||
}
|
||||
llvm_value_set(be_value, val, expr->type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define COMPILER_VERSION "0.3.6"
|
||||
#define COMPILER_VERSION "0.3.7"
|
||||
14
test/test_suite/expressions/bit_op_on_bool.c3t
Normal file
14
test/test_suite/expressions/bit_op_on_bool.c3t
Normal file
@@ -0,0 +1,14 @@
|
||||
// #target: macos-x64
|
||||
module bitop;
|
||||
|
||||
fn bool is_newline_codepoint(uint codepoint) {
|
||||
return (bool)((codepoint == 0x00_00_24_24) | (codepoint == 0x00_00_2B_92));
|
||||
}
|
||||
|
||||
/* #expect: bitop.ll
|
||||
|
||||
%eq = icmp eq i32 %0, 9252
|
||||
%eq1 = icmp eq i32 %0, 11154
|
||||
%or = or i1 %eq, %eq1
|
||||
%1 = zext i1 %or to i8
|
||||
ret i8 %1
|
||||
14
test/test_suite2/expressions/bit_op_on_bool.c3t
Normal file
14
test/test_suite2/expressions/bit_op_on_bool.c3t
Normal file
@@ -0,0 +1,14 @@
|
||||
// #target: macos-x64
|
||||
module bitop;
|
||||
|
||||
fn bool is_newline_codepoint(uint codepoint) {
|
||||
return (bool)((codepoint == 0x00_00_24_24) | (codepoint == 0x00_00_2B_92));
|
||||
}
|
||||
|
||||
/* #expect: bitop.ll
|
||||
|
||||
%eq = icmp eq i32 %0, 9252
|
||||
%eq1 = icmp eq i32 %0, 11154
|
||||
%or = or i1 %eq, %eq1
|
||||
%1 = zext i1 %or to i8
|
||||
ret i8 %1
|
||||
Reference in New Issue
Block a user