blob: a829e030e21d0f3216c6d32f73d68d7f9fa4828a [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Test CFG simplify removal of branch instructions...
2;
Chris Lattner9a8e2f22009-09-11 17:02:12 +00003; RUN: opt < %s -simplifycfg -S | not grep br
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattnerb46665e2008-03-18 03:45:45 +00005define void @test1() {
6 br label %BB1
7BB1: ; preds = %0
8 ret void
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009}
10
Tanya Lattnerb46665e2008-03-18 03:45:45 +000011define void @test2() {
12 ret void
13BB1: ; No predecessors!
14 ret void
Dan Gohmanf17a25c2007-07-18 16:29:46 +000015}
16
Tanya Lattnerb46665e2008-03-18 03:45:45 +000017define void @test3(i1 %T) {
18 br i1 %T, label %BB1, label %BB1
19BB1: ; preds = %0, %0
20 ret void
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021}
22
23
Chris Lattnerec080e72009-10-30 22:39:36 +000024define void @test4() {
25entry:
26 br label %return
27return:
28 ret void
29}
30@test4g = global i8* blockaddress(@test4, %return)