summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-08-16 14:41:14 +0000
committerDan Gohman <gohman@apple.com>2010-08-16 14:41:14 +0000
commit7a4994356b0e9726384edda57f7db65e5bc10673 (patch)
treecefc166d9f059cd974c0f6cb85e75d82b0e0eb00 /test
parent9883b95a2bff097ec6d0f34af1ddea22bf29b6c6 (diff)
downloadllvm-7a4994356b0e9726384edda57f7db65e5bc10673.tar.gz
llvm-7a4994356b0e9726384edda57f7db65e5bc10673.tar.bz2
llvm-7a4994356b0e9726384edda57f7db65e5bc10673.tar.xz
Instead, teach SimplifyCFG to trim non-address-taken blocks from
indirectbr destination lists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/SimplifyCFG/indirectbr.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/indirectbr.ll b/test/Transforms/SimplifyCFG/indirectbr.ll
index b13433ce30..de4f5b6075 100644
--- a/test/Transforms/SimplifyCFG/indirectbr.ll
+++ b/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
+}