|
1 | 1 | /// Check for reliable availability checking in inlinable code even when
|
2 | 2 | /// skipping some function bodies. rdar://82269657
|
3 | 3 |
|
4 |
| -// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.12 |
5 |
| -// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.12 -experimental-skip-non-inlinable-function-bodies |
6 |
| -// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.12 -experimental-skip-non-inlinable-function-bodies-without-types |
7 |
| -// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.12 -experimental-skip-all-function-bodies |
| 4 | +// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.10 2>&1 \ |
| 5 | +// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL |
| 6 | +// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.10 -experimental-skip-non-inlinable-function-bodies-without-types 2>&1 \ |
| 7 | +// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL-NOT |
| 8 | +// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.10 -experimental-skip-non-inlinable-function-bodies 2>&1 \ |
| 9 | +// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES-NOT,TRC-FULL-NOT |
| 10 | +// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target x86_64-apple-macos10.10 -experimental-skip-all-function-bodies 2>&1 \ |
| 11 | +// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE-NOT,TRC-WITHTYPES-NOT,TRC-FULL-NOT |
8 | 12 |
|
9 | 13 | // REQUIRES: OS=macosx
|
10 | 14 |
|
11 |
| -@available(macOS 10.14, *) |
| 15 | +@available(macOS 10.12, *) |
12 | 16 | public func foo() { }
|
| 17 | +// TRC-API: (root versions=[10.10.0,+Inf) |
| 18 | +// TRC-API: (decl versions=[10.12,+Inf) decl=foo() |
13 | 19 |
|
14 | 20 | @inlinable public func inlinableFunc() {
|
15 |
| - if #available(macOS 10.14, *) { |
| 21 | + if #available(macOS 10.12, *) { |
16 | 22 | foo()
|
17 | 23 | }
|
18 | 24 | }
|
| 25 | +// TRC-INLINABLE: (condition_following_availability versions=[10.12,+Inf) |
| 26 | +// TRC-INLINABLE: (if_then versions=[10.12,+Inf) |
| 27 | +// TRC-INLINABLE-NOT-NOT: (condition_following_availability versions=[10.12,+Inf) |
| 28 | +// TRC-INLINABLE-NOT-NOT: (if_then versions=[10.12,+Inf) |
19 | 29 |
|
20 | 30 | public func funcWithType() {
|
21 | 31 | struct S {}
|
| 32 | + if #available(macOS 10.13, *) { |
| 33 | + foo() |
| 34 | + } |
| 35 | +} |
| 36 | +// TRC-WITHTYPES: (condition_following_availability versions=[10.13,+Inf) |
| 37 | +// TRC-WITHTYPES: (if_then versions=[10.13,+Inf) |
| 38 | +// TRC-WITHTYPES-NOT-NOT: (condition_following_availability versions=[10.13,+Inf) |
| 39 | +// TRC-WITHTYPES-NOT-NOT: (if_then versions=[10.13,+Inf) |
| 40 | + |
| 41 | +public func funcSkippable() { |
22 | 42 | if #available(macOS 10.14, *) {
|
23 | 43 | foo()
|
24 | 44 | }
|
25 | 45 | }
|
| 46 | +// TRC-FULL: (condition_following_availability versions=[10.14,+Inf) |
| 47 | +// TRC-FULL: (if_then versions=[10.14,+Inf) |
| 48 | +// TRC-FULL-NOT-NOT: (condition_following_availability versions=[10.14,+Inf) |
| 49 | +// TRC-FULL-NOT-NOT: (if_then versions=[10.14,+Inf) |
0 commit comments