Skip to content

Commit 372b28b

Browse files
committed
[DAGCombine] Add pre-commit tests. NFC.
1 parent ac82955 commit 372b28b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

llvm/test/CodeGen/X86/pr152630.ll

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2+
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
3+
4+
define i32 @pr152630(i1 %cond) nounwind {
5+
; CHECK-LABEL: pr152630:
6+
; CHECK: # %bb.0: # %entry
7+
; CHECK-NEXT: andl $1, %edi
8+
; CHECK-NEXT: decl %edi
9+
; CHECK-NEXT: cmpl $255, %edi
10+
; CHECK-NEXT: je .LBB0_2
11+
; CHECK-NEXT: # %bb.1: # %entry
12+
; CHECK-NEXT: movzbl %dil, %eax
13+
; CHECK-NEXT: testl %eax, %eax
14+
; CHECK-NEXT: jne .LBB0_3
15+
; CHECK-NEXT: .LBB0_2: # %if.then
16+
; CHECK-NEXT: xorl %eax, %eax
17+
; CHECK-NEXT: retq
18+
; CHECK-NEXT: .LBB0_3: # %if.else
19+
; CHECK-NEXT: movl $1, %eax
20+
; CHECK-NEXT: retq
21+
entry:
22+
%sel = select i1 %cond, i32 0, i32 -1
23+
%conv = trunc nsw i32 %sel to i8
24+
switch i8 %conv, label %if.else [
25+
i8 -1, label %if.then
26+
i8 0, label %if.then
27+
]
28+
29+
if.then:
30+
ret i32 0
31+
32+
if.else:
33+
ret i32 1
34+
}

0 commit comments

Comments
 (0)