aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-25 02:50:08 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-25 02:50:08 +0000
commita498747842072b1665327c98c5b6c942006084a4 (patch)
tree57ce2e0fb097156f9131634f7cfc544dfc219374
parente8f38486394f3a897e3637b559ade420dddbe1e3 (diff)
A test case for the the ExitInMain libcall simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21521 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/SimplifyLibCalls/2005-04-24-ExitInMain.ll13
-rw-r--r--test/Transforms/SimplifyLibCalls/dg.exp3
2 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/2005-04-24-ExitInMain.ll b/test/Transforms/SimplifyLibCalls/2005-04-24-ExitInMain.ll
new file mode 100644
index 0000000000..f33eac072c
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/2005-04-24-ExitInMain.ll
@@ -0,0 +1,13 @@
+; Test that the ExitInMainOptimization pass works correctly
+; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep -c 'ret int 3' | grep 1
+
+declare void "exit"(int)
+declare void "exitonly"(int)
+
+implementation ; Functions:
+
+int "main"() {
+ call void "exitonly" ( int 3 )
+ call void "exit" ( int 3 )
+ ret int 0
+}
diff --git a/test/Transforms/SimplifyLibCalls/dg.exp b/test/Transforms/SimplifyLibCalls/dg.exp
new file mode 100644
index 0000000000..e326ea721c
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm-dg.exp
+
+llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]] $objdir $srcdir $subdir $target_triplet $llvmgcc $llvmgxx $prcontext