From 928f3d73f621694263ba10adc6c847c7ca06c5a4 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Fri, 14 Oct 2016 20:51:41 +0000 Subject: [PATCH] [PowerPC] add tests for PR30661 llvm-svn: 284279 --- llvm/test/CodeGen/PowerPC/negate-i1.ll | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 llvm/test/CodeGen/PowerPC/negate-i1.ll diff --git a/llvm/test/CodeGen/PowerPC/negate-i1.ll b/llvm/test/CodeGen/PowerPC/negate-i1.ll new file mode 100644 index 0000000..17cf82d --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/negate-i1.ll @@ -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 +} + -- 2.7.4