1 ; Make sure we don't end up in an infinite recursion in singleReachablePHIPath().
2 ; RUN: opt < %s -passes=newgvn -S | FileCheck %s
4 @c = external global i64, align 8
6 ; CHECK-LABEL: define void @tinkywinky() {
8 ; CHECK-NEXT: br i1 undef, label %l2, label %if.then
9 ; CHECK: if.then: ; preds = %entry
10 ; CHECK-NEXT: br label %for.body
11 ; CHECK: ph: ; preds = %back, %ontrue
12 ; CHECK-NEXT: br label %for.body
13 ; CHECK: for.body: ; preds = %ph, %if.then
14 ; CHECK-NEXT: br i1 undef, label %ontrue, label %onfalse
15 ; CHECK: onfalse: ; preds = %for.body
16 ; CHECK-NEXT: %patatino = load i64, ptr @c
17 ; CHECK-NEXT: ret void
18 ; CHECK: ontrue: ; preds = %for.body
19 ; CHECK-NEXT: %dipsy = load i64, ptr @c
20 ; CHECK-NEXT: br label %ph
21 ; CHECK: back: ; preds = %l2
22 ; CHECK-NEXT: store i8 poison, ptr null
23 ; CHECK-NEXT: br label %ph
24 ; CHECK: end: ; preds = %l2
25 ; CHECK-NEXT: ret void
26 ; CHECK: l2: ; preds = %entry
27 ; CHECK-NEXT: br i1 false, label %back, label %end
30 define void @tinkywinky() {
32 br i1 undef, label %l2, label %if.then
38 br i1 undef, label %ontrue, label %onfalse
40 %patatino = load i64, ptr @c
41 store i64 %patatino, ptr @c
44 %dipsy = load i64, ptr @c
45 store i64 %dipsy, ptr @c
52 br i1 false, label %back, label %end