46 lines · plain
1; RUN: llc %s -o - -verify-machineinstrs | FileCheck %s2 3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4target triple = "x86_64-unknown-unknown"5 6; The machine level BranchFolding pass will try to remove the 'unreachable' block7; 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 landing10; pad.11 12declare i32 @__gxx_personality_v0(...)13declare void @foo()14 15; Function Attrs: noreturn16declare void @_throw()17 18; CHECK-LABEL: @main19; CHECK: %unreachable20 21define i32 @main(ptr %cleanup) personality ptr @__gxx_personality_v0 {22entry:23 invoke void @_throw() #024 to label %unreachable unwind label %catch.dispatch925 26catch.dispatch9: ; preds = %entry27 %tmp13 = landingpad { ptr, i32 }28 cleanup29 catch ptr null30 invoke void @_throw() #031 to label %unreachable unwind label %lpad3132 33lpad31: ; preds = %catch.dispatch934 %tmp20 = landingpad { ptr, i32 }35 cleanup36 catch ptr null37 call void @foo()38 unreachable39 40unreachable: ; preds = %catch.dispatch9, %entry41 unreachable42}43 44attributes #0 = { noreturn }45 46