Skip to content

Commit 0bf3aa9

Browse files
committed
AST: Add AvailabilityContext::getVersionString() for debugging and diagnostics.
NFC (except for debug output).
1 parent 01215b0 commit 0bf3aa9

7 files changed

+126
-111
lines changed

include/swift/AST/Availability.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,14 @@ class AvailabilityContext {
307307

308308
/// Returns a representation of this range as a string for debugging purposes.
309309
std::string getAsString() const {
310-
return "AvailabilityContext(" + Range.getAsString() + ")";
310+
return "AvailabilityContext(" + getVersionString() + ")";
311+
}
312+
313+
/// Returns a representation of the raw version range as a string for
314+
/// debugging purposes.
315+
std::string getVersionString() const {
316+
assert(Range.hasLowerEndpoint());
317+
return Range.getLowerEndpoint().getAsString();
311318
}
312319
};
313320

lib/AST/TypeRefinementContext.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,22 @@ TypeRefinementContext::getAvailabilityConditionVersionSourceRange(
360360
llvm_unreachable("Unhandled Reason in switch.");
361361
}
362362

363+
static std::string
364+
stringForAvailability(const AvailabilityContext &availability) {
365+
if (availability.isAlwaysAvailable())
366+
return "all";
367+
if (availability.isKnownUnreachable())
368+
return "none";
369+
370+
return availability.getVersionString();
371+
}
372+
363373
void TypeRefinementContext::print(raw_ostream &OS, SourceManager &SrcMgr,
364374
unsigned Indent) const {
365375
OS.indent(Indent);
366376
OS << "(" << getReasonName(getReason());
367377

368-
OS << " versions=" << AvailabilityInfo.getVersionRange().getAsString();
378+
OS << " version=" << stringForAvailability(AvailabilityInfo);
369379

370380
if (getReason() == Reason::Decl || getReason() == Reason::DeclImplicit) {
371381
Decl *D = Node.getAsDecl();
@@ -390,8 +400,8 @@ void TypeRefinementContext::print(raw_ostream &OS, SourceManager &SrcMgr,
390400
}
391401

392402
if (!ExplicitAvailabilityInfo.isAlwaysAvailable())
393-
OS << " explicit_versions="
394-
<< ExplicitAvailabilityInfo.getVersionRange().getAsString();
403+
OS << " explicit_version="
404+
<< stringForAvailability(ExplicitAvailabilityInfo);
395405

396406
for (TypeRefinementContext *Child : Children) {
397407
OS << '\n';

lib/SIL/IR/SILPrinter.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3438,8 +3438,7 @@ void SILFunction::print(SILPrintContext &PrintCtx) const {
34383438
OS << "[weak_imported] ";
34393439
auto availability = getAvailabilityForLinkage();
34403440
if (!availability.isAlwaysAvailable()) {
3441-
auto version = availability.getVersionRange().getLowerEndpoint();
3442-
OS << "[available " << version.getAsString() << "] ";
3441+
OS << "[available " << availability.getVersionString() << "] ";
34433442
}
34443443

34453444
switch (getInlineStrategy()) {
@@ -4410,8 +4409,7 @@ void SILSpecializeAttr::print(llvm::raw_ostream &OS) const {
44104409
OS << "target: \"" << targetFunction->getName() << "\", ";
44114410
}
44124411
if (!availability.isAlwaysAvailable()) {
4413-
auto version = availability.getVersionRange().getLowerEndpoint();
4414-
OS << "available: " << version.getAsString() << ", ";
4412+
OS << "available: " << availability.getVersionString() << ", ";
44154413
}
44164414
if (!requirements.empty()) {
44174415
OS << "where ";

test/Sema/availability_and_delayed_parsing.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
@available(macOS 10.12, *)
2323
public func foo() { }
24-
// TRC-API: (root versions=[10.10,+Inf)
25-
// TRC-API: (decl versions=[10.12,+Inf) decl=foo()
24+
// TRC-API: (root version=10.10
25+
// TRC-API: (decl version=10.12 decl=foo()
2626

2727
#if canImport(Swift)
2828
@available(macOS 10.10, *)
@@ -38,11 +38,11 @@ public func foo() { }
3838
}
3939
}
4040
#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)
41+
// TRC-FULL: (decl version=10.10 decl=extension.String
42+
// TRC-WITHTYPES: (condition_following_availability version=10.12
43+
// TRC-WITHTYPES: (if_then version=10.12
44+
// TRC-WITHTYPES-NOT-NOT: (condition_following_availability version=10.12
45+
// TRC-WITHTYPES-NOT-NOT: (if_then version=10.12
4646

4747
struct S {
4848
fileprivate var actual: [String] = [] {
@@ -53,36 +53,36 @@ struct S {
5353
}
5454
}
5555
}
56-
// TRC-API: (condition_following_availability versions=[10.15,+Inf)
57-
// TRC-API: (if_then versions=[10.15,+Inf)
56+
// TRC-API: (condition_following_availability version=10.15
57+
// TRC-API: (if_then version=10.15
5858

5959
@inlinable public func inlinableFunc() {
6060
if #available(macOS 10.12, *) {
6161
foo()
6262
}
6363
}
64-
// TRC-INLINABLE: (condition_following_availability versions=[10.12,+Inf)
65-
// TRC-INLINABLE: (if_then versions=[10.12,+Inf)
66-
// TRC-INLINABLE-NOT-NOT: (condition_following_availability versions=[10.12,+Inf)
67-
// TRC-INLINABLE-NOT-NOT: (if_then versions=[10.12,+Inf)
64+
// TRC-INLINABLE: (condition_following_availability version=10.12
65+
// TRC-INLINABLE: (if_then version=10.12
66+
// TRC-INLINABLE-NOT-NOT: (condition_following_availability version=10.12
67+
// TRC-INLINABLE-NOT-NOT: (if_then version=10.12
6868

6969
public func funcWithType() {
7070
struct S {}
7171
if #available(macOS 10.13, *) {
7272
foo()
7373
}
7474
}
75-
// TRC-WITHTYPES: (condition_following_availability versions=[10.13,+Inf)
76-
// TRC-WITHTYPES: (if_then versions=[10.13,+Inf)
77-
// TRC-WITHTYPES-NOT-NOT: (condition_following_availability versions=[10.13,+Inf)
78-
// TRC-WITHTYPES-NOT-NOT: (if_then versions=[10.13,+Inf)
75+
// TRC-WITHTYPES: (condition_following_availability version=10.13
76+
// TRC-WITHTYPES: (if_then version=10.13
77+
// TRC-WITHTYPES-NOT-NOT: (condition_following_availability version=10.13
78+
// TRC-WITHTYPES-NOT-NOT: (if_then version=10.13
7979

8080
public func funcSkippable() {
8181
if #available(macOS 10.14, *) {
8282
foo()
8383
}
8484
}
85-
// TRC-FULL: (condition_following_availability versions=[10.14,+Inf)
86-
// TRC-FULL: (if_then versions=[10.14,+Inf)
87-
// TRC-FULL-NOT-NOT: (condition_following_availability versions=[10.14,+Inf)
88-
// TRC-FULL-NOT-NOT: (if_then versions=[10.14,+Inf)
85+
// TRC-FULL: (condition_following_availability version=10.14
86+
// TRC-FULL: (if_then version=10.14
87+
// TRC-FULL-NOT-NOT: (condition_following_availability version=10.14
88+
// TRC-FULL-NOT-NOT: (if_then version=10.14

test/Sema/availability_refinement_contexts.swift

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33

44
// REQUIRES: OS=macosx
55

6-
// CHECK: {{^}}(root versions=[50,+Inf)
7-
8-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=SomeClass
9-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someMethod()
10-
// CHECK-NEXT: {{^}} (decl versions=[53,+Inf) decl=someInnerFunc()
11-
// CHECK-NEXT: {{^}} (decl versions=[53,+Inf) decl=InnerClass
12-
// CHECK-NEXT: {{^}} (decl versions=[54,+Inf) decl=innerClassMethod
13-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someStaticProperty
14-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someStaticProperty
15-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someStaticPropertyInferredType
16-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someStaticPropertyInferredType
17-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=multiPatternStaticPropertyA
18-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=multiPatternStaticPropertyA
19-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someComputedProperty
20-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someComputedProperty
21-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someOtherMethod()
6+
// CHECK: {{^}}(root version=50
7+
8+
// CHECK-NEXT: {{^}} (decl version=51 decl=SomeClass
9+
// CHECK-NEXT: {{^}} (decl version=52 decl=someMethod()
10+
// CHECK-NEXT: {{^}} (decl version=53 decl=someInnerFunc()
11+
// CHECK-NEXT: {{^}} (decl version=53 decl=InnerClass
12+
// CHECK-NEXT: {{^}} (decl version=54 decl=innerClassMethod
13+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someStaticProperty
14+
// CHECK-NEXT: {{^}} (decl version=52 decl=someStaticProperty
15+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someStaticPropertyInferredType
16+
// CHECK-NEXT: {{^}} (decl version=52 decl=someStaticPropertyInferredType
17+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=multiPatternStaticPropertyA
18+
// CHECK-NEXT: {{^}} (decl version=52 decl=multiPatternStaticPropertyA
19+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someComputedProperty
20+
// CHECK-NEXT: {{^}} (decl version=52 decl=someComputedProperty
21+
// CHECK-NEXT: {{^}} (decl version=52 decl=someOtherMethod()
2222
@available(OSX 51, *)
2323
class SomeClass {
2424
@available(OSX 52, *)
@@ -56,14 +56,14 @@ class SomeClass {
5656
func someOtherMethod() { }
5757
}
5858

59-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=someFunction()
59+
// CHECK-NEXT: {{^}} (decl version=51 decl=someFunction()
6060
@available(OSX 51, *)
6161
func someFunction() { }
6262

63-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=SomeProtocol
64-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=protoMethod()
65-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=protoProperty
66-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=protoProperty
63+
// CHECK-NEXT: {{^}} (decl version=51 decl=SomeProtocol
64+
// CHECK-NEXT: {{^}} (decl version=52 decl=protoMethod()
65+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=protoProperty
66+
// CHECK-NEXT: {{^}} (decl version=52 decl=protoProperty
6767
@available(OSX 51, *)
6868
protocol SomeProtocol {
6969
@available(OSX 52, *)
@@ -73,27 +73,27 @@ protocol SomeProtocol {
7373
var protoProperty: Int { get }
7474
}
7575

76-
// CHECK-NEXT: {{^}} (decl_implicit versions=[50,+Inf) decl=extension.SomeClass
77-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=extension.SomeClass
78-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someExtensionFunction()
76+
// CHECK-NEXT: {{^}} (decl_implicit version=50 decl=extension.SomeClass
77+
// CHECK-NEXT: {{^}} (decl version=51 decl=extension.SomeClass
78+
// CHECK-NEXT: {{^}} (decl version=52 decl=someExtensionFunction()
7979
@available(OSX 51, *)
8080
extension SomeClass {
8181
@available(OSX 52, *)
8282
func someExtensionFunction() { }
8383
}
8484

85-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=functionWithStmtCondition
86-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[52,+Inf)
87-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[53,+Inf)
88-
// CHECK-NEXT: {{^}} (if_then versions=[53,+Inf)
89-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[54,+Inf)
90-
// CHECK-NEXT: {{^}} (if_then versions=[54,+Inf)
91-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[55,+Inf)
92-
// CHECK-NEXT: {{^}} (decl versions=[55,+Inf) decl=funcInGuardElse()
93-
// CHECK-NEXT: {{^}} (guard_fallthrough versions=[55,+Inf)
94-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[56,+Inf)
95-
// CHECK-NEXT: {{^}} (guard_fallthrough versions=[56,+Inf)
96-
// CHECK-NEXT: {{^}} (decl versions=[57,+Inf) decl=funcInInnerIfElse()
85+
// CHECK-NEXT: {{^}} (decl version=51 decl=functionWithStmtCondition
86+
// CHECK-NEXT: {{^}} (condition_following_availability version=52
87+
// CHECK-NEXT: {{^}} (condition_following_availability version=53
88+
// CHECK-NEXT: {{^}} (if_then version=53
89+
// CHECK-NEXT: {{^}} (condition_following_availability version=54
90+
// CHECK-NEXT: {{^}} (if_then version=54
91+
// CHECK-NEXT: {{^}} (condition_following_availability version=55
92+
// CHECK-NEXT: {{^}} (decl version=55 decl=funcInGuardElse()
93+
// CHECK-NEXT: {{^}} (guard_fallthrough version=55
94+
// CHECK-NEXT: {{^}} (condition_following_availability version=56
95+
// CHECK-NEXT: {{^}} (guard_fallthrough version=56
96+
// CHECK-NEXT: {{^}} (decl version=57 decl=funcInInnerIfElse()
9797
@available(OSX 51, *)
9898
func functionWithStmtCondition() {
9999
if #available(OSX 52, *),
@@ -112,11 +112,11 @@ func functionWithStmtCondition() {
112112
}
113113
}
114114

115-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=functionWithUnnecessaryStmtCondition
116-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[53,+Inf)
117-
// CHECK-NEXT: {{^}} (if_then versions=[53,+Inf)
118-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[54,+Inf)
119-
// CHECK-NEXT: {{^}} (if_then versions=[54,+Inf)
115+
// CHECK-NEXT: {{^}} (decl version=51 decl=functionWithUnnecessaryStmtCondition
116+
// CHECK-NEXT: {{^}} (condition_following_availability version=53
117+
// CHECK-NEXT: {{^}} (if_then version=53
118+
// CHECK-NEXT: {{^}} (condition_following_availability version=54
119+
// CHECK-NEXT: {{^}} (if_then version=54
120120

121121
@available(OSX 51, *)
122122
func functionWithUnnecessaryStmtCondition() {
@@ -142,13 +142,13 @@ func functionWithUnnecessaryStmtCondition() {
142142
}
143143
}
144144

145-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=functionWithUnnecessaryStmtConditionsHavingElseBranch
146-
// CHECK-NEXT: {{^}} (if_else versions=empty
147-
// CHECK-NEXT: {{^}} (decl versions=empty decl=funcInInnerIfElse()
148-
// CHECK-NEXT: {{^}} (if_else versions=empty
149-
// CHECK-NEXT: {{^}} (guard_else versions=empty
150-
// CHECK-NEXT: {{^}} (guard_else versions=empty
151-
// CHECK-NEXT: {{^}} (if_else versions=empty
145+
// CHECK-NEXT: {{^}} (decl version=51 decl=functionWithUnnecessaryStmtConditionsHavingElseBranch
146+
// CHECK-NEXT: {{^}} (if_else version=none
147+
// CHECK-NEXT: {{^}} (decl version=none decl=funcInInnerIfElse()
148+
// CHECK-NEXT: {{^}} (if_else version=none
149+
// CHECK-NEXT: {{^}} (guard_else version=none
150+
// CHECK-NEXT: {{^}} (guard_else version=none
151+
// CHECK-NEXT: {{^}} (if_else version=none
152152

153153
@available(OSX 51, *)
154154
func functionWithUnnecessaryStmtConditionsHavingElseBranch(p: Int?) {
@@ -195,10 +195,10 @@ func functionWithUnnecessaryStmtConditionsHavingElseBranch(p: Int?) {
195195

196196
}
197197

198-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=functionWithWhile()
199-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[52,+Inf)
200-
// CHECK-NEXT: {{^}} (while_body versions=[52,+Inf)
201-
// CHECK-NEXT: {{^}} (decl versions=[54,+Inf) decl=funcInWhileBody()
198+
// CHECK-NEXT: {{^}} (decl version=51 decl=functionWithWhile()
199+
// CHECK-NEXT: {{^}} (condition_following_availability version=52
200+
// CHECK-NEXT: {{^}} (while_body version=52
201+
// CHECK-NEXT: {{^}} (decl version=54 decl=funcInWhileBody()
202202
@available(OSX 51, *)
203203
func functionWithWhile() {
204204
while #available(OSX 52, *),
@@ -208,16 +208,16 @@ func functionWithWhile() {
208208
}
209209
}
210210

211-
// CHECK-NEXT: {{^}} (decl_implicit versions=[50,+Inf) decl=extension.SomeClass
212-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=extension.SomeClass
213-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someStaticPropertyWithClosureInit
214-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someStaticPropertyWithClosureInit
215-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[54,+Inf)
216-
// CHECK-NEXT: {{^}} (if_then versions=[54,+Inf)
217-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someStaticPropertyWithClosureInitInferred
218-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someStaticPropertyWithClosureInitInferred
219-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[54,+Inf)
220-
// CHECK-NEXT: {{^}} (if_then versions=[54,+Inf)
211+
// CHECK-NEXT: {{^}} (decl_implicit version=50 decl=extension.SomeClass
212+
// CHECK-NEXT: {{^}} (decl version=51 decl=extension.SomeClass
213+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someStaticPropertyWithClosureInit
214+
// CHECK-NEXT: {{^}} (decl version=52 decl=someStaticPropertyWithClosureInit
215+
// CHECK-NEXT: {{^}} (condition_following_availability version=54
216+
// CHECK-NEXT: {{^}} (if_then version=54
217+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someStaticPropertyWithClosureInitInferred
218+
// CHECK-NEXT: {{^}} (decl version=52 decl=someStaticPropertyWithClosureInitInferred
219+
// CHECK-NEXT: {{^}} (condition_following_availability version=54
220+
// CHECK-NEXT: {{^}} (if_then version=54
221221
@available(OSX 51, *)
222222
extension SomeClass {
223223
@available(OSX 52, *)
@@ -237,21 +237,21 @@ extension SomeClass {
237237
}()
238238
}
239239

240-
// CHECK-NEXT: {{^}} (decl_implicit versions=[50,+Inf) decl=wrappedValue
240+
// CHECK-NEXT: {{^}} (decl_implicit version=50 decl=wrappedValue
241241

242242
@propertyWrapper
243243
struct Wrapper<T> {
244244
var wrappedValue: T
245245
}
246246

247-
// CHECK-NEXT: {{^}} (decl versions=[51,+Inf) decl=SomeStruct
248-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someLazyVar
249-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[52,+Inf)
250-
// CHECK-NEXT: {{^}} (guard_fallthrough versions=[52,+Inf)
251-
// CHECK-NEXT: {{^}} (decl_implicit versions=[51,+Inf) decl=someWrappedVar
252-
// CHECK-NEXT: {{^}} (condition_following_availability versions=[52,+Inf)
253-
// CHECK-NEXT: {{^}} (guard_fallthrough versions=[52,+Inf)
254-
// CHECK-NEXT: {{^}} (decl versions=[52,+Inf) decl=someMethodAvailable52()
247+
// CHECK-NEXT: {{^}} (decl version=51 decl=SomeStruct
248+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someLazyVar
249+
// CHECK-NEXT: {{^}} (condition_following_availability version=52
250+
// CHECK-NEXT: {{^}} (guard_fallthrough version=52
251+
// CHECK-NEXT: {{^}} (decl_implicit version=51 decl=someWrappedVar
252+
// CHECK-NEXT: {{^}} (condition_following_availability version=52
253+
// CHECK-NEXT: {{^}} (guard_fallthrough version=52
254+
// CHECK-NEXT: {{^}} (decl version=52 decl=someMethodAvailable52()
255255
@available(OSX 51, *)
256256
struct SomeStruct {
257257
lazy var someLazyVar = {

test/Sema/availability_refinement_contexts_target_min_inlining.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
// Verify that -target-min-inlining-version min implies the correct OS version
77
// for the target OS.
88

9-
// CHECK-macosx: {{^}}(root versions=[10.10.0,+Inf)
10-
// CHECK-ios: {{^}}(root versions=[8.0,+Inf)
11-
// CHECK-tvos: {{^}}(root versions=[9.0,+Inf)
12-
// CHECK-watchos: {{^}}(root versions=[2.0,+Inf)
13-
// CHECK-xros: {{^}}(root versions=[1.0,+Inf)
9+
// CHECK-macosx: {{^}}(root version=10.10.0
10+
// CHECK-ios: {{^}}(root version=8.0
11+
// CHECK-tvos: {{^}}(root version=9.0
12+
// CHECK-watchos: {{^}}(root version=2.0
13+
// CHECK-xros: {{^}}(root version=1.0
1414

15-
// CHECK-macosx-NEXT: {{^}} (decl_implicit versions=[10.15,+Inf) decl=foo()
16-
// CHECK-ios-NEXT: {{^}} (decl_implicit versions=[13,+Inf) decl=foo()
17-
// CHECK-tvos-NEXT: {{^}} (decl_implicit versions=[13,+Inf) decl=foo()
18-
// CHECK-watchos-NEXT: {{^}} (decl_implicit versions=[6,+Inf) decl=foo()
15+
// CHECK-macosx-NEXT: {{^}} (decl_implicit version=10.15 decl=foo()
16+
// CHECK-ios-NEXT: {{^}} (decl_implicit version=13 decl=foo()
17+
// CHECK-tvos-NEXT: {{^}} (decl_implicit version=13 decl=foo()
18+
// CHECK-watchos-NEXT: {{^}} (decl_implicit version=6 decl=foo()
1919

2020
func foo() {}

test/Sema/availability_refinement_contexts_target_min_inlining_maccatalyst.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
// Verify that -target-min-inlining-version min implies 13.1 on macCatalyst.
1212

13-
// CHECK: {{^}}(root versions=[13.1,+Inf)
14-
// CHECK-NEXT: {{^}} (decl_implicit versions=[14.4,+Inf) decl=foo()
13+
// CHECK: {{^}}(root version=13.1
14+
// CHECK-NEXT: {{^}} (decl_implicit version=14.4 decl=foo()
1515
func foo() {}

0 commit comments

Comments
 (0)