From: Sanjay Patel Date: Mon, 10 Apr 2017 16:28:08 +0000 (+0000) Subject: [InstCombine] add test for PR32524; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31ad416f00be3e8d2892156c7f9fdf3572faa1da;p=llvm [InstCombine] add test for PR32524; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299846 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Transforms/InstCombine/or.ll b/test/Transforms/InstCombine/or.ll index be1e8e6d4a9..2ac6f5b1104 100644 --- a/test/Transforms/InstCombine/or.ll +++ b/test/Transforms/InstCombine/or.ll @@ -215,11 +215,25 @@ define i1 @test19(i32 %A) { ; %B = icmp eq i32 %A, 50 %C = icmp eq i32 %A, 51 - ;; (A&-2) == 50 %D = or i1 %B, %C ret i1 %D } +; PR32524: https://bugs.llvm.org/show_bug.cgi?id=32524 + +define i1 @or_icmps_eq_diff1(i32 %x) { +; CHECK-LABEL: @or_icmps_eq_diff1( +; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 %x, -1 +; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i32 %x, 0 +; CHECK-NEXT: [[LOGIC:%.*]] = or i1 [[CMP1]], [[CMP2]] +; CHECK-NEXT: ret i1 [[LOGIC]] +; + %cmp1 = icmp eq i32 %x, -1 + %cmp2 = icmp eq i32 %x, 0 + %logic = or i1 %cmp1, %cmp2 + ret i1 %logic +} + define i32 @test20(i32 %x) { ; CHECK-LABEL: @test20( ; CHECK-NEXT: ret i32 %x