@@ -129,12 +129,26 @@ func testCFuncPtrCall() {
129
129
funcPtr ( )
130
130
}
131
131
132
+ protocol TestMethodProtocol {
133
+ func method( _ x: CInt ) -> CInt
134
+ }
135
+
136
+ extension TestClass : TestMethodProtocol {
137
+ }
138
+
139
+ func testProtocolConformanceThunkInvoke( ) {
140
+ let v = TestClass ( )
141
+ let p : TestMethodProtocol = v
142
+ let _ = p. method ( 2 )
143
+ }
144
+
132
145
let _ = testFreeFunctionNoThrowOnly ( )
133
146
let _ = testFreeFunctionCalls ( )
134
147
let _ = testMethodCalls ( )
135
148
testTemplateCalls ( )
136
149
testFuncPtrCall ( )
137
150
testCFuncPtrCall ( )
151
+ testProtocolConformanceThunkInvoke ( )
138
152
139
153
// CHECK: define {{.*}} @"$s4test0A23FreeFunctionNoThrowOnlys5Int32VyF"() #[[#SWIFTMETA:]] {
140
154
// CHECK-NEXT: :
@@ -222,6 +236,23 @@ testCFuncPtrCall()
222
236
// CHECK: [[CONT21]]:
223
237
// CHECK-NEXT: ret void
224
238
239
+ // CHECK: define {{.*}} @"$sSo9TestClassV4test0A14MethodProtocolA2cDP6methodys5Int32VAHFTW"({{.*}}) #[[#SWIFTUWMETA]] personality
240
+ // CHECK: invoke i32 @_ZNK9TestClass6methodEi({{.*}})
241
+ // CHECK-NEXT: to label %[[CONT30:.*]] unwind label %[[UNWIND30:.*]]
242
+ // CHECK: [[CONT30]]:
243
+ // CHECK-NEXT: ret i32
244
+ // CHECK-EMPTY:
245
+ // CHECK-NEXT: [[UNWIND30]]:
246
+ // CHECK-NEXT: %4 = landingpad { i8*, i32 }
247
+ // CHECK-NEXT: catch i8* null
248
+ // CHECK-NEXT: call void @llvm.trap()
249
+ // CHECK-NEXT: unreachable
250
+ // CHECK-NEXT: }
251
+
252
+ // CHECK: define {{.*}} @"$s4test0A30ProtocolConformanceThunkInvokeyyF"() #[[#SWIFTMETA]]
253
+ // CHECK-NOT: invoke
254
+ // CHECK: }
255
+
225
256
// CHECK: i32 @__gxx_personality_v0(...)
226
257
227
258
// CHECK: attributes #[[#SWIFTMETA]] = {
0 commit comments