1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

Add test case for truncated and promotion to test. NFC

llvm-svn: 323663
This commit is contained in:
Amaury Sechet 2018-01-29 16:13:01 +00:00
parent 81fdbd3283
commit 5f102ef6ee

View File

@ -481,4 +481,53 @@ no:
ret void ret void
} }
define void @truncand32(i16 inreg %x) nounwind {
; CHECK-LINUX64-LABEL: truncand32:
; CHECK-LINUX64: # %bb.0:
; CHECK-LINUX64-NEXT: andl $2049, %edi # imm = 0x801
; CHECK-LINUX64-NEXT: testw %di, %di
; CHECK-LINUX64-NEXT: je .LBB11_1
; CHECK-LINUX64-NEXT: # %bb.2: # %no
; CHECK-LINUX64-NEXT: retq
; CHECK-LINUX64-NEXT: .LBB11_1: # %yes
; CHECK-LINUX64-NEXT: pushq %rax
; CHECK-LINUX64-NEXT: callq bar
; CHECK-LINUX64-NEXT: popq %rax
; CHECK-LINUX64-NEXT: retq
;
; CHECK-WIN32-64-LABEL: truncand32:
; CHECK-WIN32-64: # %bb.0:
; CHECK-WIN32-64-NEXT: subq $40, %rsp
; CHECK-WIN32-64-NEXT: andl $2049, %ecx # imm = 0x801
; CHECK-WIN32-64-NEXT: testw %cx, %cx
; CHECK-WIN32-64-NEXT: je .LBB11_1
; CHECK-WIN32-64-NEXT: # %bb.2: # %no
; CHECK-WIN32-64-NEXT: addq $40, %rsp
; CHECK-WIN32-64-NEXT: retq
; CHECK-WIN32-64-NEXT: .LBB11_1: # %yes
; CHECK-WIN32-64-NEXT: callq bar
; CHECK-WIN32-64-NEXT: addq $40, %rsp
; CHECK-WIN32-64-NEXT: retq
;
; CHECK-X86-LABEL: truncand32:
; CHECK-X86: # %bb.0:
; CHECK-X86-NEXT: andl $2049, %eax # imm = 0x801
; CHECK-X86-NEXT: testw %ax, %ax
; CHECK-X86-NEXT: je .LBB11_1
; CHECK-X86-NEXT: # %bb.2: # %no
; CHECK-X86-NEXT: retl
; CHECK-X86-NEXT: .LBB11_1: # %yes
; CHECK-X86-NEXT: calll bar
; CHECK-X86-NEXT: retl
%t = and i16 %x, 2049
%s = icmp eq i16 %t, 0
br i1 %s, label %yes, label %no
yes:
call void @bar()
ret void
no:
ret void
}
declare void @bar() declare void @bar()