1 ; RUN: llc < %s -O1 -mtriple thumbv7-apple-ios6
2 ; Just make sure no one tries to make the assumption that the normal edge of an
3 ; invoke is never a critical edge. Previously, this code would assert.
5 %struct.__CFString = type opaque
7 declare void @bar(%struct.__CFString*, %struct.__CFString*)
9 define noalias i8* @foo(i8* nocapture %inRefURL) noreturn ssp {
11 %call = tail call %struct.__CFString* @bar3()
12 %call2 = invoke i8* @bar2()
13 to label %for.cond unwind label %lpad
15 for.cond: ; preds = %entry, %for.cond
16 invoke void @bar(%struct.__CFString* undef, %struct.__CFString* null)
17 to label %for.cond unwind label %lpad5
19 lpad: ; preds = %entry
20 %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
22 %1 = extractvalue { i8*, i32 } %0, 0
23 %2 = extractvalue { i8*, i32 } %0, 1
26 lpad5: ; preds = %for.cond
27 %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
29 %4 = extractvalue { i8*, i32 } %3, 0
30 %5 = extractvalue { i8*, i32 } %3, 1
31 invoke void @release(i8* %call2)
32 to label %ehcleanup unwind label %terminate.lpad.i.i16
34 terminate.lpad.i.i16: ; preds = %lpad5
35 %6 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
37 tail call void @terminatev() noreturn nounwind
40 ehcleanup: ; preds = %lpad5, %lpad
41 %exn.slot.0 = phi i8* [ %1, %lpad ], [ %4, %lpad5 ]
42 %ehselector.slot.0 = phi i32 [ %2, %lpad ], [ %5, %lpad5 ]
43 %7 = bitcast %struct.__CFString* %call to i8*
44 invoke void @release(i8* %7)
45 to label %_ZN5SmartIPK10__CFStringED1Ev.exit unwind label %terminate.lpad.i.i
47 terminate.lpad.i.i: ; preds = %ehcleanup
48 %8 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
50 tail call void @terminatev() noreturn nounwind
53 _ZN5SmartIPK10__CFStringED1Ev.exit: ; preds = %ehcleanup
54 %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn.slot.0, 0
55 %lpad.val12 = insertvalue { i8*, i32 } %lpad.val, i32 %ehselector.slot.0, 1
56 resume { i8*, i32 } %lpad.val12
59 declare %struct.__CFString* @bar3()
63 declare i32 @__gxx_personality_sj0(...)
65 declare void @release(i8*)
67 declare void @terminatev()