From: Kazu Hirata Date: Tue, 21 Feb 2023 01:00:03 +0000 (-0800) Subject: [X86] Precommit a test X-Git-Tag: upstream/17.0.6~16938 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd5d92e6220905f7d942a81108266d427babe143;p=platform%2Fupstream%2Fllvm.git [X86] Precommit a test This is for: https://github.com/llvm/llvm-project/issues/60854 --- diff --git a/llvm/test/CodeGen/X86/select_const.ll b/llvm/test/CodeGen/X86/select_const.ll index d35cd65..fbabd9b 100644 --- a/llvm/test/CodeGen/X86/select_const.ll +++ b/llvm/test/CodeGen/X86/select_const.ll @@ -580,3 +580,18 @@ define i32 @select_ugt3_3_2(i32 %X) { %cond = select i1 %cmp.inv, i32 3, i32 2 ret i32 %cond } + +define i32 @select_eq_1_2(i32 %a, i32 %b) { +; CHECK-LABEL: select_eq_1_2: +; CHECK: # %bb.0: +; CHECK-NEXT: xorl %ecx, %ecx +; CHECK-NEXT: cmpl %esi, %edi +; CHECK-NEXT: sete %cl +; CHECK-NEXT: movl $2, %eax +; CHECK-NEXT: subl %ecx, %eax +; CHECK-NEXT: retq + + %cmp = icmp eq i32 %a, %b + %cond = select i1 %cmp, i32 1, i32 2 + ret i32 %cond +}