[PowerPC] add tests for PR30661

llvm-svn: 284279
This commit is contained in:
Sanjay Patel 2016-10-14 20:51:41 +00:00
parent d397ea4d6f
commit 928f3d73f6
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
; RUN: llc < %s -mtriple=powerpc64-apple-darwin | FileCheck %s
; PR30661 - https://llvm.org/bugs/show_bug.cgi?id=30661
define i32 @select_i32_neg1_or_0(i1 %a) {
; CHECK-LABEL: select_i32_neg1_or_0:
; CHECK: ; BB#0:
; CHECK-NEXT: sldi r2, r3, 63
; CHECK-NEXT: sradi r3, r2, 63
; CHECK-NEXT: blr
;
%b = sext i1 %a to i32
ret i32 %b
}
define i32 @select_i32_neg1_or_0_zeroext(i1 zeroext %a) {
; CHECK-LABEL: select_i32_neg1_or_0_zeroext:
; CHECK: ; BB#0:
; CHECK-NEXT: sldi r2, r3, 63
; CHECK-NEXT: sradi r3, r2, 63
; CHECK-NEXT: blr
;
%b = sext i1 %a to i32
ret i32 %b
}