From dd2fb6c10b30e70ab8f910e21e583be3e90bb88c Mon Sep 17 00:00:00 2001 From: Richard Osborne Date: Fri, 20 Jul 2012 10:36:17 +0000 Subject: Fix assertion in jump threading (PR13405). GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't true if the block ends in an indirect branch with no successors. Fix this by bailing out earlier in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160546 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll (limited to 'test') diff --git a/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll b/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll new file mode 100644 index 0000000000..1c2c0c75e3 --- /dev/null +++ b/test/Transforms/JumpThreading/2012-07-19-NoSuccessorIndirectBr.ll @@ -0,0 +1,8 @@ +; RUN: opt < %s -jump-threading +; PR 13405 +; Just check that it doesn't crash / assert + +define i32 @f() nounwind { +entry: + indirectbr i8* undef, [] +} -- cgit v1.2.3