From 31c803b2ba6333a9db18c384dff6b5da92e1d314 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sun, 24 Oct 2010 12:23:30 +0000 Subject: Fix PR8445: a block with no predecessors may be the entry block, in which case it isn't unreachable and should not be zapped. The check for the entry block was missing in one case: a block containing a unwind instruction. While there, do some small cleanups: "M" is not a great name for a Function* (it would be more appropriate for a Module*), change it to "Fn"; use Fn in more places. llvm-svn: 117224 --- llvm/test/Transforms/SimplifyCFG/2010-10-24-OnlyUnwindInEntry.ll | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 llvm/test/Transforms/SimplifyCFG/2010-10-24-OnlyUnwindInEntry.ll (limited to 'llvm/test/Transforms/SimplifyCFG') diff --git a/llvm/test/Transforms/SimplifyCFG/2010-10-24-OnlyUnwindInEntry.ll b/llvm/test/Transforms/SimplifyCFG/2010-10-24-OnlyUnwindInEntry.ll new file mode 100644 index 00000000000..ebacf2fe9a9 --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/2010-10-24-OnlyUnwindInEntry.ll @@ -0,0 +1,6 @@ +; RUN: opt %s -simplifycfg -disable-output +; PR8445 + +define void @test() { + unwind +} -- cgit v1.2.3