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! +}