1 ; RUN: llc < %s -mtriple=aarch64-apple-ios -verify-machineinstrs
3 ; This function tests that the machine verifier accepts an unconditional
4 ; branch from an invoke basic block, to its EH landing pad basic block.
5 ; The test is brittle and isn't ideally reduced, because in most cases the
6 ; branch would be removed (for instance, turned into a fallthrough), and in
7 ; that case, the machine verifier, which relies on analyzing branches for this
8 ; kind of verification, is unable to check anything, so accepts the CFG.
10 define void @test_branch_to_landingpad() personality ptr @__objc_personality_v0 {
12 br i1 undef, label %if.end50.thread, label %if.then6
15 %0 = landingpad { ptr, i32 }
16 catch ptr @"OBJC_EHTYPE_$_NSString"
17 catch ptr @OBJC_EHTYPE_id
19 br i1 undef, label %invoke.cont33, label %catch.fallthrough
22 %matches31 = icmp eq i32 undef, 0
23 br i1 %matches31, label %invoke.cont41, label %finally.catchall
26 invoke void @objc_exception_throw()
27 to label %invoke.cont7 unwind label %lpad
33 tail call void (ptr, ...) @printf(ptr @.str1, i32 125)
34 tail call void (ptr, ...) @printf(ptr @.str1, i32 128)
38 tail call void (ptr, ...) @printf(ptr @.str1, i32 119)
42 invoke void @objc_exception_rethrow()
43 to label %invoke.cont43 unwind label %lpad40
49 %1 = landingpad { ptr, i32 }
51 br label %finally.catchall
54 tail call void (ptr, ...) @printf(ptr @.str1, i32 125)
58 %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765 = type { ptr, ptr, ptr }
59 %struct._class_t.10.127.192.283.348.491.517.530.569.595.621.764 = type { ptr, ptr, ptr, ptr, ptr }
60 %struct._objc_cache.0.117.182.273.338.481.507.520.559.585.611.754 = type opaque
61 %struct._class_ro_t.9.126.191.282.347.490.516.529.568.594.620.763 = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
62 %struct.__method_list_t.2.119.184.275.340.483.509.522.561.587.613.756 = type { i32, i32, [0 x %struct._objc_method.1.118.183.274.339.482.508.521.560.586.612.755] }
63 %struct._objc_method.1.118.183.274.339.482.508.521.560.586.612.755 = type { ptr, ptr, ptr }
64 %struct._objc_protocol_list.6.123.188.279.344.487.513.526.565.591.617.760 = type { i64, [0 x ptr] }
65 %struct._protocol_t.5.122.187.278.343.486.512.525.564.590.616.759 = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr }
66 %struct._ivar_list_t.8.125.190.281.346.489.515.528.567.593.619.762 = type { i32, i32, [0 x %struct._ivar_t.7.124.189.280.345.488.514.527.566.592.618.761] }
67 %struct._ivar_t.7.124.189.280.345.488.514.527.566.592.618.761 = type { ptr, ptr, ptr, i32, i32 }
68 %struct._prop_list_t.4.121.186.277.342.485.511.524.563.589.615.758 = type { i32, i32, [0 x %struct._prop_t.3.120.185.276.341.484.510.523.562.588.614.757] }
69 %struct._prop_t.3.120.185.276.341.484.510.523.562.588.614.757 = type { ptr, ptr }
71 @.str1 = external unnamed_addr constant [17 x i8], align 1
72 @OBJC_EHTYPE_id = external global %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765
73 @"OBJC_EHTYPE_$_NSString" = external global %struct._objc_typeinfo.12.129.194.285.350.493.519.532.571.597.623.765, section "__DATA,__datacoal_nt,coalesced", align 8
75 declare void @objc_exception_throw()
76 declare void @objc_exception_rethrow()
77 declare i32 @__objc_personality_v0(...)
78 declare void @printf(ptr nocapture readonly, ...)