diff options
author | Chris Lattner <sabre@nondot.org> | 2005-04-27 04:51:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-04-27 04:51:01 +0000 |
commit | cd4b7a4454950799aa9f95826f8231e6764da283 (patch) | |
tree | 45ef9b925de2535ab61f89cff04a0cfce9e9f70e /test/Transforms/PruneEH | |
parent | ff1c9e21479fd50374515942bb4e45a7e66b5171 (diff) | |
download | external_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.ll | 16 |
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! +} |