| ; RUN: opt < %s -passes='print<phi-values>' -disable-output 2>&1 | FileCheck %s |
| ; This test has a phi with a large number of incoming values that are all the |
| ; same phi, and that phi depends on this phi. This is to check that phi values |
| ; analysis doesn't repeatedly add a phis values to itself until it segfaults. |
| ; CHECK-LABEL: PHI Values for function: fn |
| define void @fn(i8* %arg) { |
| ; CHECK: PHI %phi1 has values: |
| %phi1 = phi i8* [ %arg, %entry ], [ %phi2, %end ] |
| switch i32 undef, label %end [ |
| ; CHECK: PHI %phi2 has values: |
| %phi2 = phi i8* [ %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 ] |