1 ; RUN: opt < %s -passes='print<phi-values>' -disable-output 2>&1 | FileCheck %s
3 ; This test has a phi with a large number of incoming values that are all the
4 ; same phi, and that phi depends on this phi. This is to check that phi values
5 ; analysis doesn't repeatedly add a phis values to itself until it segfaults.
7 ; CHECK-LABEL: PHI Values for function: fn
8 define void @fn(ptr %arg) {
13 ; CHECK: PHI %phi1 has values:
15 ; CHECK-DAG: ptr undef
16 %phi1 = phi ptr [ %arg, %entry ], [ %phi2, %end ]
17 switch i32 undef, label %end [
73 ; CHECK: PHI %phi2 has values:
75 ; CHECK-DAG: ptr undef
76 %phi2 = phi ptr [ %phi1, %for.body ], [ %phi1, %bb1 ], [ %phi1, %bb2 ], [ %phi1, %bb3 ], [ %phi1, %bb4 ], [ %phi1, %bb5 ], [ %phi1, %bb6 ], [ %phi1, %bb7 ], [ undef, %bb8 ], [ %phi1, %bb9 ], [ %phi1, %bb10 ], [ %phi1, %bb11 ], [ %phi1, %bb12 ], [ %phi1, %bb13 ]