11/// Check for reliable availability checking in inlinable code even when
22/// skipping some function bodies. rdar://82269657
33
4+ /// Default build mode reading everything
45// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 2>&1 \
56// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL
7+
8+ /// Emit-module-separately mode / for LLDB
69// 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 \
710// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES,TRC-FULL-NOT
11+
12+ /// InstallAPI mode
813// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 -experimental-skip-non-inlinable-function-bodies 2>&1 \
914// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE,TRC-WITHTYPES-NOT,TRC-FULL-NOT
15+
16+ /// Index build mode
1017// RUN: %target-swift-frontend -typecheck -dump-type-refinement-contexts %s -target %target-cpu-apple-macos10.10 -experimental-skip-all-function-bodies 2>&1 \
1118// RUN: | %FileCheck %s --check-prefixes TRC-API,TRC-INLINABLE-NOT,TRC-WITHTYPES-NOT,TRC-FULL-NOT
1219
@@ -17,6 +24,26 @@ public func foo() { }
1724// TRC-API: (root versions=[10.10.0,+Inf)
1825// TRC-API: (decl versions=[10.12,+Inf) decl=foo()
1926
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+
2047struct S {
2148 fileprivate var actual : [ String ] = [ ] {
2249 didSet {
0 commit comments