blob: a2aa82568315096d230e7eb2158a44916383e97e [file] [log] [blame]
David Majnemer08566532016-09-16 02:43:36 +00001; RUN: opt -S -simplifycfg < %s | FileCheck %s
2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-unknown-linux-gnu"
4
5declare i32* @fn1(i32* returned)
6
7define i32 @test1(i1 %B) {
8entry:
9 br label %for.cond.us
10
11for.cond.us: ; preds = %for.cond.us, %entry
12 br i1 %B, label %for.cond4.preheader, label %for.cond.us
13
14for.cond4.preheader: ; preds = %for.cond.us
15 br i1 %B, label %for.cond4.preheader.split.us, label %for.cond4
16
17for.cond4.preheader.split.us: ; preds = %for.cond4.preheader
18 unreachable
19
20for.cond4: ; preds = %for.end, %for.cond4.preheader
21 %phi = phi i32* [ %call, %for.end ], [ undef, %for.cond4.preheader ]
22 %call = call i32* @fn1(i32* %phi)
23 br label %for.cond5
24
25for.cond5: ; preds = %for.cond5, %for.cond4
26 br i1 %B, label %for.cond5, label %for.end
27
28for.end: ; preds = %for.cond5
29 %load = load i32, i32* %call, align 4
30 br label %for.cond4
31}
32
33; CHECK-LABEL: define i32 @test1(
34; CHECK: br label %[[LABEL:.*]]
35; CHECK: [[LABEL]]:
36; CHECK: br label %[[LABEL]]