1; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement -wasm-disable-explicit-locals -wasm-keep-registers -enable-emscripten-cxx-exceptions | FileCheck %s 2 3target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" 4target triple = "wasm32-unknown-unknown" 5 6declare i32 @__gxx_personality_v0(...) 7 8; Check an interesting case of complex control flow due to exceptions CFG rewriting. 9; There should *not* be any irreducible control flow here. 10 11; CHECK-LABEL: crashy: 12; CHECK-NOT: br_table 13 14define void @crashy() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { 15entry: 16 invoke void undef() 17 to label %invoke.cont unwind label %lpad 18 19invoke.cont: ; preds = %entry 20 invoke void undef() 21 to label %invoke.cont4 unwind label %lpad3 22 23invoke.cont4: ; preds = %invoke.cont 24 %call.i82 = invoke i8* undef() 25 to label %invoke.cont6 unwind label %lpad3 26 27invoke.cont6: ; preds = %invoke.cont4 28 invoke void undef() 29 to label %invoke.cont13 unwind label %lpad12 30 31invoke.cont13: ; preds = %invoke.cont6 32 br label %for.cond 33 34for.cond: ; preds = %for.cond.backedge, %invoke.cont13 35 br i1 undef, label %exit2, label %land.lhs 36 37land.lhs: ; preds = %for.cond 38 %call.i.i.i.i92 = invoke i32 undef() 39 to label %exit1 unwind label %lpad16.loopexit 40 41exit1: ; preds = %land.lhs 42 br label %exit2 43 44exit2: ; preds = %exit1, %for.cond 45 %call.i.i12.i.i93 = invoke i32 undef() 46 to label %exit3 unwind label %lpad16.loopexit 47 48exit3: ; preds = %exit2 49 invoke void undef() 50 to label %invoke.cont23 unwind label %lpad22 51 52invoke.cont23: ; preds = %exit3 53 invoke void undef() 54 to label %invoke.cont25 unwind label %lpad22 55 56invoke.cont25: ; preds = %invoke.cont23 57 %call.i.i137 = invoke i32 undef() 58 to label %invoke.cont29 unwind label %lpad16.loopexit 59 60lpad: ; preds = %entry 61 %0 = landingpad { i8*, i32 } 62 cleanup 63 unreachable 64 65lpad3: ; preds = %invoke.cont4, %invoke.cont 66 %1 = landingpad { i8*, i32 } 67 cleanup 68 unreachable 69 70lpad12: ; preds = %invoke.cont6 71 %2 = landingpad { i8*, i32 } 72 cleanup 73 resume { i8*, i32 } undef 74 75lpad16.loopexit: ; preds = %if.then, %invoke.cont29, %invoke.cont25, %exit2, %land.lhs 76 %lpad.loopexit = landingpad { i8*, i32 } 77 cleanup 78 unreachable 79 80lpad22: ; preds = %invoke.cont23, %exit3 81 %3 = landingpad { i8*, i32 } 82 cleanup 83 unreachable 84 85invoke.cont29: ; preds = %invoke.cont25 86 invoke void undef() 87 to label %invoke.cont33 unwind label %lpad16.loopexit 88 89invoke.cont33: ; preds = %invoke.cont29 90 br label %for.inc 91 92for.inc: ; preds = %invoke.cont33 93 %cmp.i.i141 = icmp eq i8* undef, undef 94 br i1 %cmp.i.i141, label %if.then, label %if.end.i.i146 95 96if.then: ; preds = %for.inc 97 %call.i.i148 = invoke i32 undef() 98 to label %for.cond.backedge unwind label %lpad16.loopexit 99 100for.cond.backedge: ; preds = %if.end.i.i146, %if.then 101 br label %for.cond 102 103if.end.i.i146: ; preds = %for.inc 104 call void undef() 105 br label %for.cond.backedge 106} 107