From 093b896dcb1cbe99bae8a32c285f92d2148795cd Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 12 Feb 2019 01:46:30 +0000 Subject: [PATCH] [x86] add tests for logic of setcc (PR40611); NFC llvm-svn: 353789 --- llvm/test/CodeGen/X86/setcc-logic.ll | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/llvm/test/CodeGen/X86/setcc-logic.ll b/llvm/test/CodeGen/X86/setcc-logic.ll index 231b9f4d0860..290a8c38a291 100644 --- a/llvm/test/CodeGen/X86/setcc-logic.ll +++ b/llvm/test/CodeGen/X86/setcc-logic.ll @@ -482,3 +482,33 @@ define <4 x i1> @and_eq_vec(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> ret <4 x i1> %and } +define i1 @or_icmps_const_1bit_diff(i8 %x) { +; CHECK-LABEL: or_icmps_const_1bit_diff: +; CHECK: # %bb.0: +; CHECK-NEXT: cmpb $43, %dil +; CHECK-NEXT: sete %cl +; CHECK-NEXT: cmpb $45, %dil +; CHECK-NEXT: sete %al +; CHECK-NEXT: orb %cl, %al +; CHECK-NEXT: retq + %a = icmp eq i8 %x, 43 + %b = icmp eq i8 %x, 45 + %r = or i1 %a, %b + ret i1 %r +} + +define i1 @and_icmps_const_1bit_diff(i32 %x) { +; CHECK-LABEL: and_icmps_const_1bit_diff: +; CHECK: # %bb.0: +; CHECK-NEXT: cmpl $44, %edi +; CHECK-NEXT: setne %cl +; CHECK-NEXT: cmpl $60, %edi +; CHECK-NEXT: setne %al +; CHECK-NEXT: andb %cl, %al +; CHECK-NEXT: retq + %a = icmp ne i32 %x, 44 + %b = icmp ne i32 %x, 60 + %r = and i1 %a, %b + ret i1 %r +} +