aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/PruneEH
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-27 04:51:01 +0000
committerChris Lattner <sabre@nondot.org>2005-04-27 04:51:01 +0000
commitcd4b7a4454950799aa9f95826f8231e6764da283 (patch)
tree45ef9b925de2535ab61f89cff04a0cfce9e9f70e /test/Transforms/PruneEH
parentff1c9e21479fd50374515942bb4e45a7e66b5171 (diff)
downloadexternal_llvm-cd4b7a4454950799aa9f95826f8231e6764da283.zip
external_llvm-cd4b7a4454950799aa9f95826f8231e6764da283.tar.gz
external_llvm-cd4b7a4454950799aa9f95826f8231e6764da283.tar.bz2
Test the noreturn function optimization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/PruneEH')
-rw-r--r--test/Transforms/PruneEH/simplenoreturntest.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/PruneEH/simplenoreturntest.ll b/test/Transforms/PruneEH/simplenoreturntest.ll
new file mode 100644
index 0000000..29cf9e5
--- /dev/null
+++ b/test/Transforms/PruneEH/simplenoreturntest.ll
@@ -0,0 +1,16 @@
+; RUN: llvm-as < %s | opt -prune-eh | llvm-dis | not grep 'ret int'
+
+void %noreturn() {
+ unwind
+}
+
+int %caller() {
+ ; noreturn never returns, so the ret is unreachable.
+ call void %noreturn()
+ ret int 17
+}
+
+int %caller2() {
+ %T = call int %caller()
+ ret int %T ;; this is also unreachable!
+}