diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-23 08:23:54 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-23 08:23:54 +0000 |
commit | 521fc5bcd73489f604a0b3251247c5ef21b5a0a5 (patch) | |
tree | ce33b8f13e1b6e5e1e4749a77d02bd62f2c172a8 /test | |
parent | 23d66a58b7900784a5808d24ce2d4a449f869aa8 (diff) | |
download | external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.zip external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.tar.gz external_llvm-521fc5bcd73489f604a0b3251247c5ef21b5a0a5.tar.bz2 |
Handle the case of a no-return invoke correctly. It actually still has
successors, they just are all landing pad successors. We handle this the
same way as no successors. Comments attached for the next person to wade
through here and another lovely test case courtesy of Benjamin Kramer's
bugpoint reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/block-placement.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/block-placement.ll b/test/CodeGen/X86/block-placement.ll index 05d6f81..c03b03e 100644 --- a/test/CodeGen/X86/block-placement.ll +++ b/test/CodeGen/X86/block-placement.ll @@ -504,6 +504,30 @@ loop: br label %loop } +declare void @fake_throw() noreturn + +define void @test_eh_throw() { +; For blocks containing a 'throw' (or similar functionality), we have +; a no-return invoke. In this case, only EH successors will exist, and +; fallthrough simply won't occur. Make sure we don't crash trying to update +; terminators for such constructs. +; +; CHECK: test_eh_throw +; CHECK: %entry +; CHECK: %cleanup + +entry: + invoke void @fake_throw() to label %continue unwind label %cleanup + +continue: + unreachable + +cleanup: + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup + unreachable +} + define void @test_unnatural_cfg_backwards_inner_loop() { ; Test that when we encounter an unnatural CFG structure after having formed ; a chain for an inner loop which happened to be laid out backwards we don't |