blob: 8abf3b1cc46ba9dc287604f2c3a210603463ef8c [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Test that the ExitInMainOptimization pass works correctly
Tanya Lattner003eae52008-03-10 07:21:50 +00002; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
Dan Gohman552fb262007-08-15 13:49:33 +00003; RUN: grep {ret i32 3} | count 1
Dan Gohmanf17a25c2007-07-18 16:29:46 +00004; END.
5
Tanya Lattner003eae52008-03-10 07:21:50 +00006declare void @exit(i32)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007
Tanya Lattner003eae52008-03-10 07:21:50 +00008declare void @exitonly(i32)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009
Tanya Lattner003eae52008-03-10 07:21:50 +000010define i32 @main() {
11 call void @exitonly( i32 3 )
12 call void @exit( i32 3 )
13 ret i32 0
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014}
Tanya Lattner003eae52008-03-10 07:21:50 +000015