1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/test/CodeGen/X86/win64-bool.ll
Reid Kleckner bc8c141758 [X86] Fix Windows i1 zeroext conventions to use i8 instead of i32
Summary:
Re-lands r328386 and r328443, reverting r328482.

Incorporates fixes from @mstorsjo in D44876 (thanks!) so that small
parameters in i8 and i16 do not end up in the SysV register parameters
(EDI, ESI, etc).

I added tests for how we receive small parameters, since that is the
important part. It's always safe to store more bytes than will be read,
but the assumptions you make when loading them are what really matter.

I also tested this by self-hosting clang and it passed tests on win64.

Reviewers: mstorsjo, hans

Subscribers: hiraditya, mstorsjo, llvm-commits

Differential Revision: https://reviews.llvm.org/D44900

llvm-svn: 328570
2018-03-26 18:49:48 +00:00

24 lines
522 B
LLVM

; RUN: llc < %s -mtriple=x86_64-windows-msvc | FileCheck %s --check-prefix=CHECK
; RUN: llc < %s -mtriple=x86_64-windows-gnu | FileCheck %s --check-prefix=CHECK
define i32 @pass_bool(i1 zeroext %b) {
entry:
%cond = select i1 %b, i32 66, i32 0
ret i32 %cond
}
; CHECK-LABEL: pass_bool:
; CHECK-DAG: testb %cl, %cl
; CHECK-DAG: movl $66,
; CHECK: cmovel {{.*}}, %eax
; CHECK: retq
define zeroext i1 @ret_true() {
entry:
ret i1 true
}
; CHECK-LABEL: ret_true:
; CHECK: movb $1, %al
; CHECK: retq