blob: ef368906378d754c50a6e603c6d571ecc460049d [file] [log] [blame]
Tanya Lattner003eae52008-03-10 07:21:50 +00001; RUN: llvm-as < %s | opt -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