From cd4b7a4454950799aa9f95826f8231e6764da283 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 27 Apr 2005 04:51:01 +0000 Subject: [PATCH] Test the noreturn function optimization git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21586 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/PruneEH/simplenoreturntest.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/Transforms/PruneEH/simplenoreturntest.ll diff --git a/test/Transforms/PruneEH/simplenoreturntest.ll b/test/Transforms/PruneEH/simplenoreturntest.ll new file mode 100644 index 00000000000..29cf9e5c82f --- /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! +}