From bb4f8e62bf0070b459d60cc350526df0ec2c41c4 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 25 Apr 2015 15:51:09 +0000 Subject: [PATCH] * sign/zero-extend a Pascal boolean (translated to i1) when assigning to an i8, even though both have byte size 1 git-svn-id: trunk@30713 - --- compiler/llvm/llvmdef.pas | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/llvm/llvmdef.pas b/compiler/llvm/llvmdef.pas index 6e9cb3a8b1..e2590f16e6 100644 --- a/compiler/llvm/llvmdef.pas +++ b/compiler/llvm/llvmdef.pas @@ -210,6 +210,17 @@ implementation end; end; end + else if is_pasbool(fromsize) and + not is_pasbool(tosize) then + begin + if is_cbool(tosize) then + result:=la_sext + else + result:=la_zext + end + else if is_pasbool(tosize) and + not is_pasbool(fromsize) then + result:=la_trunc else result:=la_bitcast; end;