In C++, code is not allowed to call main. In C it is, this

simplifylibcalls optimization is thus valid for C++ but not C.
It's not important enough to worry about for C++ apps, so just
remove it.

rdar://7191924



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-09-03 05:19:59 +00:00
parent 47548d3365
commit e9f9a7e10e
2 changed files with 4 additions and 72 deletions

View File

@@ -1,15 +0,0 @@
; Test that the ExitInMainOptimization pass works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | \
; RUN: grep {ret i32 3} | count 1
; END.
declare void @exit(i32)
declare void @exitonly(i32)
define i32 @main() {
call void @exitonly( i32 3 )
call void @exit( i32 3 )
ret i32 0
}