summaryrefslogtreecommitdiff
path: root/test/Transforms/SimplifyLibCalls/ExitInMain.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/SimplifyLibCalls/ExitInMain.ll')
-rw-r--r--test/Transforms/SimplifyLibCalls/ExitInMain.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyLibCalls/ExitInMain.ll b/test/Transforms/SimplifyLibCalls/ExitInMain.ll
new file mode 100644
index 000000000000..8abf3b1cc46b
--- /dev/null
+++ b/test/Transforms/SimplifyLibCalls/ExitInMain.ll
@@ -0,0 +1,15 @@
+; 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
+}
+