1 ; RUN: llc %s -o - -verify-machineinstrs | FileCheck %s
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-unknown"
6 ; The machine level BranchFolding pass will try to remove the 'unreachable' block
7 ; and rewrite 'entry' to jump to the block 'unreachable' falls through to.
8 ; That will be a landing pad and result in 'entry' jumping to 2 landing pads.
9 ; This tests that we don't do this change when the fallthrough is itself a landing
12 declare i32 @__gxx_personality_v0(...)
15 ; Function Attrs: noreturn
16 declare void @_throw()
21 define i32 @main(ptr %cleanup) personality ptr @__gxx_personality_v0 {
23 invoke void @_throw() #0
24 to label %unreachable unwind label %catch.dispatch9
26 catch.dispatch9: ; preds = %entry
27 %tmp13 = landingpad { ptr, i32 }
30 invoke void @_throw() #0
31 to label %unreachable unwind label %lpad31
33 lpad31: ; preds = %catch.dispatch9
34 %tmp20 = landingpad { ptr, i32 }
40 unreachable: ; preds = %catch.dispatch9, %entry
44 attributes #0 = { noreturn }