Bump to 0.3.7. Fixes issue with bitoperations on booleans.

This commit is contained in:
Christoffer Lerno
2022-08-10 11:01:14 +02:00
parent 9473adbc35
commit cfcf5cbc16
4 changed files with 34 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -1 +1 @@
#define COMPILER_VERSION "0.3.6"
#define COMPILER_VERSION "0.3.7"

View 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

View 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