1; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
2
3define void @t() nounwind ssp {
4; CHECK-LABEL: t:
5entry:
6  br i1 undef, label %return, label %if.end.i
7
8if.end.i:                                         ; preds = %entry
9  %tmp7.i = load i32, i32* undef, align 4
10  br i1 undef, label %return, label %if.end
11
12if.end:                                           ; preds = %if.end.i
13; CHECK: %if.end
14; CHECK: movl (%{{.*}}), [[REG:%[a-z]+]]
15; CHECK-NOT: movl [[REG]], [[REG]]
16; CHECK-NEXT: testl [[REG]], [[REG]]
17; CHECK-NEXT: xorl
18  %tmp138 = select i1 undef, i32 0, i32 %tmp7.i
19  %tmp867 = zext i32 %tmp138 to i64
20  br label %while.cond
21
22while.cond:                                       ; preds = %while.body, %if.end
23  %tmp869 = sub i64 %tmp867, 0
24  %scale2.0 = trunc i64 %tmp869 to i32
25  %cmp149 = icmp eq i32 %scale2.0, 0
26  br i1 %cmp149, label %while.end, label %land.rhs
27
28land.rhs:                                         ; preds = %while.cond
29  br i1 undef, label %while.body, label %while.end
30
31while.body:                                       ; preds = %land.rhs
32  br label %while.cond
33
34while.end:                                        ; preds = %land.rhs, %while.cond
35  br i1 undef, label %cond.false205, label %cond.true190
36
37cond.true190:                                     ; preds = %while.end
38  br i1 undef, label %cond.false242, label %cond.true225
39
40cond.false205:                                    ; preds = %while.end
41  unreachable
42
43cond.true225:                                     ; preds = %cond.true190
44  br i1 undef, label %cond.false280, label %cond.true271
45
46cond.false242:                                    ; preds = %cond.true190
47  unreachable
48
49cond.true271:                                     ; preds = %cond.true225
50  unreachable
51
52cond.false280:                                    ; preds = %cond.true225
53  unreachable
54
55return:                                           ; preds = %if.end.i, %entry
56  ret void
57}
58