1 ; RUN: opt -codegenprepare -S < %s | FileCheck %s
3 ; Test that an invalid CFG is not created by splitIndirectCriticalEdges
4 ; transformation when the 'target' block is a loop to itself.
7 ; CHECK: br label %while.body.clone
10 ; CHECK: while.body.clone:
11 ; CHECK: br label %.split
18 br i1 undef, label %while.body, label %preheader
27 %dest.sroa = phi i32 [ %1, %while.body ], [ undef, %if.else1 ], [ undef, %if.else ]
28 %0 = inttoptr i32 %dest.sroa to i8*
29 %incdec.ptr = getelementptr inbounds i8, i8* %0, i32 -1
30 %1 = ptrtoint i8* %incdec.ptr to i32
31 store i8 undef, i8* %incdec.ptr, align 1
35 indirectbr i8* undef, [label %if.then, label %while.body, label %if.else, label %if.else1]