File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
test/Interop/Cxx/exceptions Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,14 @@ CFreeFunctionTy getCFreeFunctionPointer() noexcept;
81
81
82
82
}
83
83
84
+ class ClassWithSubscript {
85
+ int m = 0 ;
86
+ public:
87
+ int operator[ ] ( int x) const {
88
+ return freeFunctionThrows( x) ;
89
+ }
90
+ } ;
91
+
84
92
//--- test.swift
85
93
86
94
import CxxModule
@@ -142,13 +150,19 @@ func testProtocolConformanceThunkInvoke() {
142
150
let _ = p. method ( 2 )
143
151
}
144
152
153
+ func testSubscriptThunkInvoke( ) -> CInt {
154
+ let v = ClassWithSubscript ( )
155
+ return v [ 0 ]
156
+ }
157
+
145
158
let _ = testFreeFunctionNoThrowOnly ( )
146
159
let _ = testFreeFunctionCalls ( )
147
160
let _ = testMethodCalls ( )
148
161
testTemplateCalls ( )
149
162
testFuncPtrCall ( )
150
163
testCFuncPtrCall ( )
151
164
testProtocolConformanceThunkInvoke ( )
165
+ let _ = testSubscriptThunkInvoke ( )
152
166
153
167
// CHECK: define {{.*}} @"$s4test0A23FreeFunctionNoThrowOnlys5Int32VyF"() #[[#SWIFTMETA:]] {
154
168
// CHECK-NEXT: :
@@ -253,6 +267,9 @@ testProtocolConformanceThunkInvoke()
253
267
// CHECK-NOT: invoke
254
268
// CHECK: }
255
269
270
+ // CHECK: define {{.*}} @"$s4test0A20SubscriptThunkInvokes5Int32VyF"() #[[#SWIFTUWMETA]]
271
+ // CHECK: invoke i32 @_ZNK18ClassWithSubscriptixEi
272
+
256
273
// CHECK: i32 @__gxx_personality_v0(...)
257
274
258
275
// CHECK: attributes #[[#SWIFTMETA]] = {
You can’t perform that action at this time.
0 commit comments