From 250b754428110bedb864e74ae7c8c59619c662e8 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 16 Aug 2010 14:41:14 +0000 Subject: Instead, teach SimplifyCFG to trim non-address-taken blocks from indirectbr destination lists. llvm-svn: 111122 --- llvm/test/Transforms/SimplifyCFG/indirectbr.ll | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/test') diff --git a/llvm/test/Transforms/SimplifyCFG/indirectbr.ll b/llvm/test/Transforms/SimplifyCFG/indirectbr.ll index b13433ce306..de4f5b60755 100644 --- a/llvm/test/Transforms/SimplifyCFG/indirectbr.ll +++ b/llvm/test/Transforms/SimplifyCFG/indirectbr.ll @@ -49,3 +49,16 @@ BB0: ret void } +; SimplifyCFG should notice that BB0 does not have its address taken and +; remove it from entry's successor list. + +; CHECK: indbrtest2 +; CHECK: entry: +; CHECK-NEXT: unreachable + +define void @indbrtest2(i8* %t) { +entry: + indirectbr i8* %t, [label %BB0, label %BB0] +BB0: + ret void +} -- cgit v1.2.3