From fd5d92e6220905f7d942a81108266d427babe143 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 20 Feb 2023 17:00:03 -0800 Subject: [PATCH] [X86] Precommit a test This is for: https://github.com/llvm/llvm-project/issues/60854 --- llvm/test/CodeGen/X86/select_const.ll | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 +} -- 2.7.4