1
1
/// Check for reliable availability checking in inlinable code even when
2
2
/// skipping some function bodies. rdar://82269657
3
3
4
+ /// Default build mode reading everything
4
5
// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 2>&1 \
5
6
// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL
7
+
8
+ /// Emit-module-separately mode / for LLDB
6
9
// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 -experimental-skip-non-inlinable-function-bodies-without-types 2>&1 \
7
10
// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL-NOT
11
+
12
+ /// InstallAPI mode
8
13
// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 -experimental-skip-non-inlinable-function-bodies 2>&1 \
9
14
// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES-NOT,TRC-FULL-NOT
15
+
16
+ /// Index build mode
10
17
// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 -experimental-skip-all-function-bodies 2>&1 \
11
18
// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE-NOT,TRC-WITHTYPES-NOT,TRC-FULL-NOT
12
19
@@ -17,6 +24,26 @@ public func foo() { }
17
24
// TRC-API: (root versions=[10.10.0,+Inf)
18
25
// TRC-API: (decl versions=[10.12,+Inf) decl=foo()
19
26
27
+ #if canImport(Swift)
28
+ @available ( macOS 10 . 10 , * )
29
+ extension String {
30
+ public var computedVariable : String {
31
+ struct SomeTypeToForceCheckingThis { }
32
+
33
+ if #available( macOS 10 . 12 , * ) {
34
+ foo ( )
35
+ }
36
+
37
+ fatalError ( )
38
+ }
39
+ }
40
+ #endif
41
+ // TRC-FULL: (decl versions=[10.10,+Inf) decl=extension.String
42
+ // TRC-WITHTYPES: (condition_following_availability versions=[10.12,+Inf)
43
+ // TRC-WITHTYPES: (if_then versions=[10.12,+Inf)
44
+ // TRC-WITHTYPES-NOT-NOT: (condition_following_availability versions=[10.12,+Inf)
45
+ // TRC-WITHTYPES-NOT-NOT: (if_then versions=[10.12,+Inf)
46
+
20
47
struct S {
21
48
fileprivate var actual : [ String ] = [ ] {
22
49
didSet {
0 commit comments