@@ -26,9 +26,23 @@ func testGlobalFunctions() {
26
26
if #_hasSymbol( forwardDeclaredFunc) { }
27
27
}
28
28
29
+ // --- function(with:) ---
29
30
// CHECK: sil hidden_external @$s17has_symbol_helper8function4withySi_tFTwS : $@convention(thin) () -> Builtin.Int1
31
+ // CHECK: sil @$s17has_symbol_helper8function4withySi_tF : $@convention(thin) (Int) -> ()
32
+
33
+ // --- genericFunc<A>(_:) ---
30
34
// CHECK: sil hidden_external @$s17has_symbol_helper11genericFuncyyxAA1PRzlFTwS : $@convention(thin) () -> Builtin.Int1
35
+ // CHECK: sil @$s17has_symbol_helper11genericFuncyyxAA1PRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
36
+
37
+ // --- cdeclFunc() ---
31
38
// CHECK: sil hidden_external @$s17has_symbol_helper9cdeclFuncyyFTwS : $@convention(thin) () -> Builtin.Int1
39
+ // CHECK: sil @$s17has_symbol_helper9cdeclFuncyyF : $@convention(thin) () -> ()
40
+ // CHECK: sil [serialized] @cdecl_func : $@convention(c) () -> ()
41
+
42
+ // --- forwardDeclaredFunc() ---
43
+ // CHECK: sil hidden_external @$s17has_symbol_helper19forwardDeclaredFuncyyFTwS : $@convention(thin) () -> Builtin.Int1
44
+ // FIXME: missing forward declared function
45
+
32
46
33
47
// CHECK: sil hidden [ossa] @$s4test0A4VarsyyF : $@convention(thin) () -> ()
34
48
func testVars( ) {
@@ -38,7 +52,10 @@ func testVars() {
38
52
if #_hasSymbol( global) { }
39
53
}
40
54
55
+ // --- global ---
41
56
// CHECK: sil hidden_external @$s17has_symbol_helper6globalSivpTwS : $@convention(thin) () -> Builtin.Int1
57
+ // CHECK: sil @$s17has_symbol_helper6globalSivg : $@convention(thin) () -> Int
58
+
42
59
43
60
// CHECK: sil hidden [ossa] @$s4test0A6Structyy17has_symbol_helper1SVF : $@convention(thin) (@in_guaranteed S) -> ()
44
61
func testStruct( _ s: S ) {
@@ -68,12 +85,34 @@ func testStruct(_ s: S) {
68
85
if #_hasSymbol( S . init ( member: ) ) { }
69
86
}
70
87
88
+ // --- S.member ---
71
89
// CHECK: sil hidden_external @$s17has_symbol_helper1SV6memberSivpTwS : $@convention(thin) () -> Builtin.Int1
90
+ // CHECK: sil @$s17has_symbol_helper1SV6memberSivg : $@convention(method) (@in_guaranteed S) -> Int
91
+ // CHECK: sil @$s17has_symbol_helper1SV6memberSivs : $@convention(method) (Int, @inout S) -> ()
92
+ // CHECK: sil @$s17has_symbol_helper1SV6memberSivM : $@yield_once @convention(method) (@inout S) -> @yields @inout Int
93
+
94
+ // --- S.method(with:) ---
72
95
// CHECK: sil hidden_external @$s17has_symbol_helper1SV6method4withySi_tFTwS : $@convention(thin) () -> Builtin.Int1
96
+ // CHECK: sil @$s17has_symbol_helper1SV6method4withySi_tF : $@convention(method) (Int, @in_guaranteed S) -> ()
97
+
98
+ // --- S.genericFunc<A>(_:) ---
73
99
// CHECK: sil hidden_external @$s17has_symbol_helper1SV11genericFuncyyxAA1PRzlFTwS : $@convention(thin) () -> Builtin.Int1
100
+ // CHECK: sil @$s17has_symbol_helper1SV11genericFuncyyxAA1PRzlF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0, @in_guaranteed S) -> ()
101
+
102
+ // --- S.staticFunc() ---
74
103
// CHECK: sil hidden_external @$s17has_symbol_helper1SV10staticFuncyyFZTwS : $@convention(thin) () -> Builtin.Int1
104
+ // CHECK: sil @$s17has_symbol_helper1SV10staticFuncyyFZ : $@convention(method) (@thin S.Type) -> ()
105
+
106
+ // --- S.staticMember ---
75
107
// CHECK: sil hidden_external @$s17has_symbol_helper1SV12staticMemberSivpZTwS : $@convention(thin) () -> Builtin.Int1
108
+ // CHECK: sil @$s17has_symbol_helper1SV12staticMemberSivgZ : $@convention(method) (@thin S.Type) -> Int
109
+ // CHECK: sil @$s17has_symbol_helper1SV12staticMemberSivsZ : $@convention(method) (Int, @thin S.Type) -> ()
110
+ // CHECK: sil @$s17has_symbol_helper1SV12staticMemberSivMZ : $@yield_once @convention(method) (@thin S.Type) -> @yields @inout Int
111
+
112
+ // --- S.init(member:) ---
76
113
// CHECK: sil hidden_external @$s17has_symbol_helper1SV6memberACSi_tcfcTwS : $@convention(thin) () -> Builtin.Int1
114
+ // sil @$s17has_symbol_helper1SV6memberACSi_tcfC : $@convention(method) (Int, @thin S.Type) -> @out S
115
+
77
116
78
117
// CHECK: sil hidden [ossa] @$s4test0A13GenericStructyy17has_symbol_helper0B1SVyAC1SVGF : $@convention(thin) (@in_guaranteed GenericS<S>) -> ()
79
118
func testGenericStruct( _ s: GenericS < S > ) {
@@ -87,8 +126,16 @@ func testGenericStruct(_ s: GenericS<S>) {
87
126
if #_hasSymbol( s. method ( with: ) ) { }
88
127
}
89
128
129
+ // --- GenericS.member ---
90
130
// CHECK: sil hidden_external @$s17has_symbol_helper8GenericSV6memberxvpTwS : $@convention(thin) () -> Builtin.Int1
131
+ // CHECK: sil @$s17has_symbol_helper8GenericSV6memberxvg : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed GenericS<τ_0_0>) -> @out τ_0_0
132
+ // CHECK: sil @$s17has_symbol_helper8GenericSV6memberxvs : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in τ_0_0, @inout GenericS<τ_0_0>) -> ()
133
+ // CHECK: sil @$s17has_symbol_helper8GenericSV6memberxvM : $@yield_once @convention(method) <τ_0_0 where τ_0_0 : P> (@inout GenericS<τ_0_0>) -> @yields @inout τ_0_0
134
+
135
+ // --- GenericS.method(with:) ---
91
136
// CHECK: sil hidden_external @$s17has_symbol_helper8GenericSV6method4withyx_tFTwS : $@convention(thin) () -> Builtin.Int1
137
+ // CHECK: sil @$s17has_symbol_helper8GenericSV6method4withyx_tF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0, @in_guaranteed GenericS<τ_0_0>) -> ()
138
+
92
139
93
140
// CHECK: sil hidden [ossa] @$s4test0A5Classyy17has_symbol_helper1CCF : $@convention(thin) (@guaranteed C) -> () {
94
141
func testClass( _ c: C ) {
@@ -114,11 +161,29 @@ func testClass(_ c: C) {
114
161
if #_hasSymbol( C . init ( member: ) ) { }
115
162
}
116
163
164
+ // --- C.member ---
117
165
// CHECK: sil hidden_external @$s17has_symbol_helper1CC6memberSivpTwS : $@convention(thin) () -> Builtin.Int1
166
+ // Method dispatch thunks are generated in IRGen so no SIL decls are expected.
167
+
168
+ // --- C.method(with:) ---
118
169
// CHECK: sil hidden_external @$s17has_symbol_helper1CC6method4withySi_tFTwS : $@convention(thin) () -> Builtin.Int1
170
+ // Method dispatch thunks are generated in IRGen so no SIL decls are expected.
171
+
172
+ // --- C.classFunc() ---
119
173
// CHECK: sil hidden_external @$s17has_symbol_helper1CC9classFuncyyFZTwS : $@convention(thin) () -> Builtin.Int1
174
+ // Method dispatch thunks are generated in IRGen so no SIL decls are expected.
175
+
176
+ // --- C.staticMember ---
120
177
// CHECK: sil hidden_external @$s17has_symbol_helper1CC12staticMemberSivpZTwS : $@convention(thin) () -> Builtin.Int1
178
+ // CHECK: sil @$s17has_symbol_helper1CC12staticMemberSivgZ : $@convention(method) (@thick C.Type) -> Int
179
+ // CHECK: sil @$s17has_symbol_helper1CC12staticMemberSivsZ : $@convention(method) (Int, @thick C.Type) -> ()
180
+ // CHECK: sil @$s17has_symbol_helper1CC12staticMemberSivMZ : $@yield_once @convention(method) (@thick C.Type) -> @yields @inout Int
181
+
182
+ // --- C.init(member:) ---
121
183
// CHECK: sil hidden_external @$s17has_symbol_helper1CC6memberACSi_tcfcTwS : $@convention(thin) () -> Builtin.Int1
184
+ // CHECK: sil @$s17has_symbol_helper1CC6memberACSi_tcfc : $@convention(method) (Int, @owned C) -> @owned C
185
+ // CHECK: sil [serialized] @$s17has_symbol_helper1CC6memberACSi_tcfC : $@convention(method) (Int, @thick C.Type) -> @owned C
186
+
122
187
123
188
// CHECK: sil hidden [ossa] @$s4test0A4Enumyy17has_symbol_helper1EOF : $@convention(thin) (@in_guaranteed E) -> ()
124
189
func testEnum( _ e: E ) {
@@ -136,9 +201,16 @@ func testEnum(_ e: E) {
136
201
if #_hasSymbol( e. method) { }
137
202
}
138
203
204
+ // --- E.basicCase(_:) ---
139
205
// CHECK: sil hidden_external @$s17has_symbol_helper1EO9basicCaseyA2CmFTwS : $@convention(thin) () -> Builtin.Int1
206
+
207
+ // --- E.payloadCase(_:) ---
140
208
// CHECK: sil hidden_external @$s17has_symbol_helper1EO11payloadCaseyAcA1SVcACmFTwS : $@convention(thin) () -> Builtin.Int1
209
+
210
+ // --- E.method() ---
141
211
// CHECK: sil hidden_external @$s17has_symbol_helper1EO6methodyyFTwS : $@convention(thin) () -> Builtin.Int1
212
+ // CHECK: sil @$s17has_symbol_helper1EO6methodyyF : $@convention(method) (@in_guaranteed E) -> ()
213
+
142
214
143
215
// CHECK: sil hidden [ossa] @$s4test0A8Protocolyyx17has_symbol_helper1PRzlF : $@convention(thin) <T where T : P> (@in_guaranteed T) -> ()
144
216
func testProtocol< T: P > ( _ p: T ) {
@@ -148,6 +220,11 @@ func testProtocol<T: P>(_ p: T) {
148
220
if #_hasSymbol( p. requirement) { }
149
221
}
150
222
223
+ // --- P.requirement() ---
224
+ // CHECK: sil hidden_external @$s17has_symbol_helper1PP11requirementyyFTwS : $@convention(thin) () -> Builtin.Int1
225
+ // CHECK: sil @$s17has_symbol_helper1PP11requirementyyF : $@convention(witness_method: P) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
226
+
227
+
151
228
// CHECK: sil hidden [ossa] @$s4test0A9MetatypesyyF : $@convention(thin) () -> ()
152
229
func testMetatypes( ) {
153
230
// CHECK: [[QUERY:%[0-9]+]] = function_ref @$s17has_symbol_helper1PPTwS : $@convention(thin) () -> Builtin.Int1
@@ -172,8 +249,17 @@ func testMetatypes() {
172
249
if #_hasSymbol( E . self) { }
173
250
}
174
251
252
+ // --- P.self ---
175
253
// CHECK: sil hidden_external @$s17has_symbol_helper1PPTwS : $@convention(thin) () -> Builtin.Int1
254
+
255
+ // --- S.self ---
176
256
// CHECK: sil hidden_external @$s17has_symbol_helper1SVTwS : $@convention(thin) () -> Builtin.Int1
257
+
258
+ // --- GenericS.self ---
177
259
// CHECK: sil hidden_external @$s17has_symbol_helper8GenericSVTwS : $@convention(thin) () -> Builtin.Int1
260
+
261
+ // --- C.self ---
178
262
// CHECK: sil hidden_external @$s17has_symbol_helper1CCTwS : $@convention(thin) () -> Builtin.Int1
263
+
264
+ // --- E.self ---
179
265
// CHECK: sil hidden_external @$s17has_symbol_helper1EOTwS : $@convention(thin) () -> Builtin.Int1
0 commit comments