blob: 94f5d87ad2bbc1b15cf66e76615ad5468961d688 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -tailduplicate -disable-output
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Tanya Lattner003eae52008-03-10 07:21:50 +00003declare void @__main()
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004
Tanya Lattner003eae52008-03-10 07:21:50 +00005define i32 @main() {
6entry:
7 call void @__main( )
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008 br label %loopentry
Tanya Lattner003eae52008-03-10 07:21:50 +00009loopentry: ; preds = %no_exit, %entry
10 %i.0 = phi i32 [ %inc, %no_exit ], [ 0, %entry ] ; <i32> [#uses=3]
11 %tmp.1 = icmp sle i32 %i.0, 99 ; <i1> [#uses=1]
12 br i1 %tmp.1, label %no_exit, label %return
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013no_exit: ; preds = %loopentry
Tanya Lattner003eae52008-03-10 07:21:50 +000014 %tmp.51 = call i32 @main( ) ; <i32> [#uses=0]
15 %inc = add i32 %i.0, 1 ; <i32> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016 br label %loopentry
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017return: ; preds = %loopentry
Tanya Lattner003eae52008-03-10 07:21:50 +000018 ret i32 %i.0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019}
Tanya Lattner003eae52008-03-10 07:21:50 +000020