summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll b/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
new file mode 100644
index 00000000000..a9fa53d3999
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/2008-07-10-CastSextBool.ll
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+define i1 @PR2539_A(i1 %A) {
+; CHECK-LABEL: @PR2539_A(
+; CHECK-NEXT: [[C:%.*]] = xor i1 %A, true
+; CHECK-NEXT: ret i1 [[C]]
+;
+ %B = zext i1 %A to i32
+ %C = icmp slt i32 %B, 1
+ ret i1 %C
+}
+
+
+define i1 @PR2539_B(i1 zeroext %b) {
+; CHECK-LABEL: @PR2539_B(
+; CHECK-NEXT: ret i1 false
+;
+ %cmp = icmp slt i1 %b, true
+ ret i1 %cmp
+}
+
OpenPOWER on IntegriCloud