1 ; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -S -mtriple=x86_64 < %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
13 define void @test(i1 %c) {
18 br i1 %c, 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 ptr
29 %incdec.ptr = getelementptr inbounds i8, ptr %0, i32 -1
30 %1 = ptrtoint ptr %incdec.ptr to i32
31 store i8 undef, ptr %incdec.ptr, align 1
35 indirectbr ptr undef, [label %if.then, label %while.body, label %if.else, label %if.else1]