13
13
// WARNING: module 'SwiftOnoneSupport' cannot be built with -experimental-skip-non-inlinable-function-bodies; this option has been automatically disabled
14
14
15
15
// Check skipped bodies are neither typechecked nor SILgen'd
16
- // RUN: %target-swift-frontend -emit-sil -emit-sorted-sil -experimental-skip-non-inlinable-function-bodies -debug-forbid-typecheck-prefix INLINENOTYPECHECK %s -o %t/Skip.noninlinable.sil
17
- // RUN: %target-swift-frontend -emit-sil -emit-sorted-sil -O - experimental-skip-all-function-bodies -debug-forbid-typecheck-prefix ALLNOTYPECHECK %s -o %t/Skip.all.sil
18
- // %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY < %t/Skip.noninlinable.sil
19
- // %FileCheck %s --check-prefixes CHECK,CHECK-ALL-ONLY < %t/Skip.all.sil
16
+ // RUN: %target-swift-frontend -emit-sil -emit-sorted-sil -experimental-skip-non-inlinable-function-bodies -debug-forbid-typecheck-prefix NEVERTYPECHECK -debug-forbid-typecheck-prefix INLINENOTYPECHECK %s -o %t/Skip.noninlinable.sil
17
+ // RUN: %target-swift-frontend -emit-sil -emit-sorted-sil -experimental-skip-all-function-bodies -debug-forbid-typecheck-prefix NEVERTYPECHECK -debug-forbid-typecheck-prefix ALLNOTYPECHECK %s -o %t/Skip.all.sil
18
+ // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY,CHECK-NONINLINE-SIL < %t/Skip.noninlinable.sil
19
+ // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-ALL-ONLY < %t/Skip.all.sil
20
20
21
21
// Emit the module interface and check it against the same set of strings.
22
22
// RUN: %target-swift-frontend -typecheck %s -enable-library-evolution -emit-module-interface-path %t/Skip.noninlinable.swiftinterface -experimental-skip-non-inlinable-function-bodies
23
- // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY < %t/Skip.noninlinable.swiftinterface
23
+ // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY,CHECK-NONINLINE-TEXTUAL < %t/Skip.noninlinable.swiftinterface
24
24
// RUN: %target-swift-frontend -typecheck %s -enable-library-evolution -emit-module-interface-path %t/Skip.all.swiftinterface -experimental-skip-all-function-bodies
25
- // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-ALL-ONLY < %t/Skip.all.swiftinterface
25
+ // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-ALL-ONLY,CHECK-NONINLINE-TEXTUAL < %t/Skip.all.swiftinterface
26
26
27
27
// Emit the module interface normally, it should be the same as when skipping
28
28
// non-inlinable.
29
29
// RUN: %target-swift-frontend -typecheck %s -enable-library-evolution -emit-module-interface-path %t/Skip.swiftinterface
30
- // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY < %t/Skip.swiftinterface
30
+ // RUN: %FileCheck %s --check-prefixes CHECK,CHECK-NONINLINE-ONLY,CHECK-NONINLINE-TEXTUAL < %t/Skip.swiftinterface
31
31
// RUN: diff -u %t/Skip.noninlinable.swiftinterface %t/Skip.swiftinterface
32
32
33
33
@usableFromInline
@@ -58,16 +58,14 @@ public class InlinableDeinit {
58
58
@_fixed_layout
59
59
public class InlineAlwaysDeinit {
60
60
@inline ( __always) deinit {
61
- let ALLNOTYPECHECK_local = 1
62
- let INLINENOTYPECHECK_local = 1
61
+ let NEVERTYPECHECK_local = 1
63
62
_blackHole ( " @inline(__always) deinit body " ) // CHECK-NOT: "@inline(__always) deinit body"
64
63
}
65
64
}
66
65
67
66
public class NormalDeinit {
68
67
deinit {
69
- let ALLNOTYPECHECK_local = 1
70
- let INLINENOTYPECHECK = 1
68
+ let NEVERTYPECHECK_local = 1
71
69
_blackHole ( " regular deinit body " ) // CHECK-NOT: "regular deinit body"
72
70
}
73
71
}
@@ -80,52 +78,44 @@ public class NormalDeinit {
80
78
}
81
79
82
80
@inline ( __always) public func inlineAlwaysFunc( ) {
83
- let ALLNOTYPECHECK_local = 1
84
- let INLINENOTYPECHECK_local = 1
81
+ let NEVERTYPECHECK_local = 1
85
82
_blackHole ( " @inline(__always) func body " ) // CHECK-NOT: "@inline(__always) func body"
86
83
}
87
84
88
85
func internalFunc( ) {
89
- let ALLNOTYPECHECK_local = 1
90
- let INLINENOTYPECHECK_local = 1
86
+ let NEVERTYPECHECK_local = 1
91
87
_blackHole ( " internal func body " ) // CHECK-NOT: "internal func body"
92
88
}
93
89
94
90
public func publicFunc( ) {
95
- let ALLNOTYPECHECK_local = 1
96
- let INLINENOTYPECHECK_local = 1
91
+ let NEVERTYPECHECK_local = 1
97
92
_blackHole ( " public func body " ) // CHECK-NOT: "public func body"
98
93
}
99
94
100
95
private func privateFunc( ) {
101
- let ALLNOTYPECHECK_local = 1
102
- let INLINENOTYPECHECK_local = 1
96
+ let NEVERTYPECHECK_local = 1
103
97
_blackHole ( " private func body " ) // CHECK-NOT: "private func body"
104
98
}
105
99
106
100
@inline ( __always) public func inlineAlwaysLocalTypeFunc( ) {
107
- let ALLNOTYPECHECK_outerLocal = 1
108
- let INLINENOTYPECHECK_outerLocal = 1
101
+ let NEVERTYPECHECK_outerLocal = 1
109
102
110
103
typealias InlineAlwaysLocalType = Int
111
104
_blackHole ( " @inline(__always) func body with local type " ) // CHECK-NOT: "@inline(__always) func body with local type"
112
105
func takesInlineAlwaysLocalType( _ x: InlineAlwaysLocalType ) {
113
- let ALLNOTYPECHECK_innerLocal = 1
114
- let INLINENOTYPECHECK_innerLocal = 1
106
+ let NEVERTYPECHECK_innerLocal = 1
115
107
_blackHole ( " nested func body inside @inline(__always) func body taking local type " ) // CHECK-NOT: "nested func body inside @inline(__always) func body taking local type"
116
108
}
117
109
takesInlineAlwaysLocalType ( 0 )
118
110
}
119
111
120
112
public func publicLocalTypeFunc( ) {
121
- let ALLNOTYPECHECK_outerLocal = 1
122
- let INLINENOTYPECHECK_outerLocal = 1
113
+ let NEVERTYPECHECK_outerLocal = 1
123
114
124
115
typealias LocalType = Int
125
116
_blackHole ( " public func body with local type " ) // CHECK-NOT: "public func body with local type"
126
117
func takesLocalType( _ x: LocalType ) {
127
- let ALLNOTYPECHECK_innerLocal = 1
128
- let INLINENOTYPECHECK_innerLocal = 1
118
+ let NEVERTYPECHECK_innerLocal = 1
129
119
_blackHole ( " nested func body inside public func body taking local type " ) // CHECK-NOT: "nested func body inside public func body taking local type"
130
120
}
131
121
takesLocalType ( 0 )
@@ -206,8 +196,7 @@ public struct Struct {
206
196
207
197
@inline ( __always)
208
198
public func inlineAlwaysFunc( ) {
209
- let ALLNOTYPECHECK_local = 1
210
- let INLINENOTYPECHECK_local = 1
199
+ let NEVERTYPECHECK_local = 1
211
200
_blackHole ( " @inline(__always) method body " ) // CHECK-NOT: "@inline(__always) method body"
212
201
}
213
202
@@ -236,13 +225,6 @@ public struct Struct {
236
225
}
237
226
}
238
227
239
- public var didSetVar : Int = 1 {
240
- didSet {
241
- // Body typechecked regardless
242
- _blackHole ( " didSet body " ) // CHECK-NOT: "didSet body"
243
- }
244
- }
245
-
246
228
@_transparent
247
229
public func transparentFunc( ) {
248
230
let ALLNOTYPECHECK_local = 1
@@ -252,20 +234,17 @@ public struct Struct {
252
234
}
253
235
254
236
func internalFunc( ) {
255
- let ALLNOTYPECHECK_local = 1
256
- let INLINENOTYPECHECK_local = 1
237
+ let NEVERTYPECHECK_local = 1
257
238
_blackHole ( " internal method body " ) // CHECK-NOT: "internal method body"
258
239
}
259
240
260
241
public func publicFunc( ) {
261
- let ALLNOTYPECHECK_local = 1
262
- let INLINENOTYPECHECK_local = 1
242
+ let NEVERTYPECHECK_local = 1
263
243
_blackHole ( " public method body " ) // CHECK-NOT: "public method body"
264
244
}
265
245
266
246
private func privateFunc( ) {
267
- let ALLNOTYPECHECK_local = 1
268
- let INLINENOTYPECHECK_local = 1
247
+ let NEVERTYPECHECK_local = 1
269
248
_blackHole ( " private method body " ) // CHECK-NOT: "private method body"
270
249
}
271
250
@@ -276,6 +255,14 @@ public struct Struct {
276
255
// CHECK-ALL-ONLY-NOT: "@_transparent init body"
277
256
}
278
257
258
+ public var didSetVar : Int = 1 {
259
+ didSet {
260
+ // Body typechecked regardless
261
+ _blackHole ( " didSet body " ) // CHECK-NONINLINE-SIL: "didSet body"
262
+ // CHECK-NONINLINE-TEXTUAL-NOT: "didSet body"
263
+ }
264
+ }
265
+
279
266
@inlinable public init ( ) {
280
267
let ALLNOTYPECHECK_local = 1
281
268
_blackHole ( " @inlinable init body " )
@@ -284,26 +271,22 @@ public struct Struct {
284
271
}
285
272
286
273
@inline ( __always) public init ( a: Int ) {
287
- let ALLNOTYPECHECK_local = 1
288
- let INLINENOTYPECHECK_local = 1
274
+ let NEVERTYPECHECK_local = 1
289
275
_blackHole ( " @inline(__always) init body " ) // CHECK-NOT: "@inline(__always) init body"
290
276
}
291
277
292
278
init ( c: Int ) {
293
- let ALLNOTYPECHECK_local = 1
294
- let INLINENOTYPECHECK_local = 1
279
+ let NEVERTYPECHECK_local = 1
295
280
_blackHole ( " internal init body " ) // CHECK-NOT: "internal init body"
296
281
}
297
282
298
283
public init ( d: Int ) {
299
- let ALLNOTYPECHECK_local = 1
300
- let INLINENOTYPECHECK_local = 1
284
+ let NEVERTYPECHECK_local = 1
301
285
_blackHole ( " public init body " ) // CHECK-NOT: "public init body"
302
286
}
303
287
304
288
private init ( e: Int ) {
305
- let ALLNOTYPECHECK_local = 1
306
- let INLINENOTYPECHECK_local = 1
289
+ let NEVERTYPECHECK_local = 1
307
290
_blackHole ( " private init body " ) // CHECK-NOT: "private init body"
308
291
}
309
292
@@ -316,8 +299,7 @@ public struct Struct {
316
299
}
317
300
318
301
@inline ( __always) public subscript( a: Int , b: Int ) -> Int {
319
- let ALLNOTYPECHECK_local = 1
320
- let INLINENOTYPECHECK_local = 1
302
+ let NEVERTYPECHECK_local = 1
321
303
_blackHole ( " @inline(__always) subscript getter " ) // CHECK-NOT: "@inline(__always) subscript getter"
322
304
return 0
323
305
}
@@ -333,54 +315,47 @@ public struct Struct {
333
315
}
334
316
335
317
subscript( a: Int , b: Int , c: Int , d: Int ) -> Int {
336
- let ALLNOTYPECHECK_local = 1
337
- let INLINENOTYPECHECK_local = 1
318
+ let NEVERTYPECHECK_local = 1
338
319
_blackHole ( " internal subscript getter " ) // CHECK-NOT: "internal subscript getter"
339
320
return 0
340
321
}
341
322
342
323
public subscript( a: Int , b: Int , c: Int , d: Int , e: Int ) -> Int {
343
- let ALLNOTYPECHECK_local = 1
344
- let INLINENOTYPECHECK_local = 1
324
+ let NEVERTYPECHECK_local = 1
345
325
_blackHole ( " public subscript getter " ) // CHECK-NOT: "public subscript getter"
346
326
return 0
347
327
}
348
328
349
329
private subscript( e: Int ) -> Int {
350
- let ALLNOTYPECHECK_local = 1
351
- let INLINENOTYPECHECK_local = 1
330
+ let NEVERTYPECHECK_local = 1
352
331
_blackHole ( " private subscript getter " ) // CHECK-NOT: "private subscript getter"
353
332
return 0
354
333
}
355
334
356
335
@inline ( __always) public var inlineAlwaysVar : Int {
357
- let ALLNOTYPECHECK_local = 1
358
- let INLINENOTYPECHECK_local = 1
336
+ let NEVERTYPECHECK_local = 1
359
337
_blackHole ( " @inline(__always) getter body " ) // CHECK-NOT: "@inline(__always) getter body"
360
338
return 0
361
339
}
362
340
363
341
public var publicVar : Int {
364
- let ALLNOTYPECHECK_local = 1
365
- let INLINENOTYPECHECK_local = 1
342
+ let NEVERTYPECHECK_local = 1
366
343
_blackHole ( " public getter body " ) // CHECK-NOT: "public getter body"
367
344
return 0
368
345
}
369
346
370
347
public var inlineAlwaysSetter : Int {
371
348
get { 0 }
372
349
@inline ( __always) set {
373
- let ALLNOTYPECHECK_local = 1
374
- let INLINENOTYPECHECK_local = 1
350
+ let NEVERTYPECHECK_local = 1
375
351
_blackHole ( " @inline(__always) setter body " ) // CHECK-NOT: "@inline(__always) setter body"
376
352
}
377
353
}
378
354
379
355
public var regularSetter : Int {
380
356
get { 0 }
381
357
set {
382
- let ALLNOTYPECHECK_local = 1
383
- let INLINENOTYPECHECK_local = 1
358
+ let NEVERTYPECHECK_local = 1
384
359
_blackHole ( " @inline(__always) setter body " ) // CHECK-NOT: "regular setter body"
385
360
}
386
361
}
0 commit comments