1 ; RUN: opt -simplifycfg < %s -S | FileCheck %s
3 ; The dead code would cause a select that had itself
4 ; as an operand to be analyzed. This would then cause
5 ; infinite recursion and eventual crash.
7 define void @PR36045(i1 %t, i32* %b) {
8 ; CHECK-LABEL: @PR36045(
10 ; CHECK-NEXT: ret void
13 br i1 %t, label %if, label %end
16 br i1 %t, label %unreach, label %pre
22 %p = phi i32 [ 70, %if ], [ %sel, %for ]
26 %cmp = icmp sgt i32 %p, 8
28 %sel = select i1 %cmp, i32 %p, i32 %add
29 %cmp21 = icmp ult i32 %sel, 21
30 br i1 %cmp21, label %pre, label %for.end
33 br i1 %t, label %unreach2, label %then12
40 %spec = phi i32 [ %sel, %for.end ], [ 42, %then12 ]