Skip to content

Commit f3a6146

Browse files
committed
[Apple Silicon] Update tests for no macOS target triple canonicalization
LLVM no longer canonicalizes target triples for maOS versions. Update tests to account for this.
1 parent d764db0 commit f3a6146

File tree

7 files changed

+69
-70
lines changed

7 files changed

+69
-70
lines changed

test/Driver/print_target_info_macos.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
// REQUIRES: OS=macosx
99

10-
// CHECK: "triple": "{{.*}}-apple-macosx10
10+
// CHECK: "triple": "{{.*}}-apple-macosx{{[0-9][0-9]}}
1111
// CHECK: "unversionedTriple": "{{.*}}-apple-macosx"

test/IRGen/osx-targets.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// REQUIRES: OS=macosx
66

7-
// CHECK: target triple = "{{.*}}-apple-macosx10.
7+
// CHECK: target triple = "{{.*}}-apple-macosx{{[0-9][0-9]}}.
88
// CHECK-SPECIFIC-MAC-10-X: target triple = "{{.*}}-apple-macosx10.51.0"
99
// CHECK-DARWIN-OVER-11: target triple = "{{.*}}-apple-macosx46.0.0"
1010

test/Interpreter/Inputs/availability_host_os.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
static inline int mavericks() { return 9; }
33
__attribute__((availability(macosx,introduced=10.10)))
44
static inline int yosemite() { return 10; }
5-
__attribute__((availability(macosx,introduced=10.99)))
5+
__attribute__((availability(macosx,introduced=99.99)))
66
static inline int todosSantos() { return 99; }

test/Interpreter/availability_host_os.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ print(mavericks()) // CHECK: {{^9$}}
1414
print(yosemite()) // CHECK-NEXT: {{^10$}}
1515

1616
#if FAIL
17-
print(todosSantos()) // expected-error {{'todosSantos()' is only available in macOS 10.99 or newer}}
17+
print(todosSantos()) // expected-error {{'todosSantos()' is only available in macOS 99.99 or newer}}
1818
// expected-note@-1 {{add 'if #available' version check}}
1919
#endif

test/Sema/Inputs/availability_multi_other.swift

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,88 +3,88 @@
33
// validate declarations when resolving declaration signatures.
44
// This file relies on the minimum deployment target for OS X being 10.9.
55

6-
@available(OSX, introduced: 10.52)
7-
private class PrivateIntroduced10_52 { }
6+
@available(OSX, introduced: 99.52)
7+
private class PrivateIntroduced99_52 { }
88

99
class OtherIntroduced10_9 { }
1010

11-
@available(OSX, introduced: 10.51)
12-
class OtherIntroduced10_51 {
13-
func uses10_52() {
11+
@available(OSX, introduced: 99.51)
12+
class OtherIntroduced99_51 {
13+
func uses99_52() {
1414
// If this were the primary file then the below would emit an error, because
15-
// PrivateIntroduced10_53 is not available on 10.52. But since we only
15+
// PrivateIntroduced99_53 is not available on 99.52. But since we only
1616
// run the first pass of the type checker on these declarations,
1717
// the body is not checked.
18-
_ = PrivateIntroduced10_52()
18+
_ = PrivateIntroduced99_52()
1919
}
2020

21-
// This method uses a 10_52 only type in its signature, so validating
21+
// This method uses a 99_52 only type in its signature, so validating
2222
// the declaration should produce an availability error
23-
func returns10_52() -> OtherIntroduced10_52 { // expected-error {{'OtherIntroduced10_52' is only available in macOS 10.52 or newer}}
23+
func returns99_52() -> OtherIntroduced99_52 { // expected-error {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}}
2424
// expected-note@-1 {{add @available attribute to enclosing instance method}}
2525

2626
// Body is not type checked (by design) so no error is expected for unavailable type used in return.
27-
return OtherIntroduced10_52()
27+
return OtherIntroduced99_52()
2828
}
2929

30-
@available(OSX, introduced: 10.52)
31-
func returns10_52Introduced10_52() -> OtherIntroduced10_52 {
32-
return OtherIntroduced10_52()
30+
@available(OSX, introduced: 99.52)
31+
func returns99_52Introduced99_52() -> OtherIntroduced99_52 {
32+
return OtherIntroduced99_52()
3333
}
3434

35-
func takes10_52(o: OtherIntroduced10_52) {
35+
func takes99_52(o: OtherIntroduced99_52) {
3636
}
3737

38-
@available(OSX, introduced: 10.52)
39-
func takes10_52Introduced10_52(o: OtherIntroduced10_52) {
38+
@available(OSX, introduced: 99.52)
39+
func takes99_52Introduced99_52(o: OtherIntroduced99_52) {
4040
}
4141

42-
var propOf10_52: OtherIntroduced10_52 =
42+
var propOf99_52: OtherIntroduced99_52 =
4343

4444

45-
OtherIntroduced10_52() // We don't expect an error here because the initializer is not type checked (by design).
45+
OtherIntroduced99_52() // We don't expect an error here because the initializer is not type checked (by design).
4646

47-
@available(OSX, introduced: 10.52)
48-
var propOf10_52Introduced10_52: OtherIntroduced10_52 = OtherIntroduced10_52()
47+
@available(OSX, introduced: 99.52)
48+
var propOf99_52Introduced99_52: OtherIntroduced99_52 = OtherIntroduced99_52()
4949

50-
@available(OSX, introduced: 10.52)
51-
class NestedIntroduced10_52 : OtherIntroduced10_52 {
52-
override func returns10_52() -> OtherIntroduced10_52 {
50+
@available(OSX, introduced: 99.52)
51+
class NestedIntroduced99_52 : OtherIntroduced99_52 {
52+
override func returns99_52() -> OtherIntroduced99_52 {
5353
}
5454

55-
@available(OSX, introduced: 10.53)
56-
func returns10_53() -> OtherIntroduced10_53 {
55+
@available(OSX, introduced: 99.53)
56+
func returns99_53() -> OtherIntroduced99_53 {
5757
}
5858
}
5959
}
6060

61-
@available(OSX, introduced: 10.51)
62-
class SubOtherIntroduced10_51 : OtherIntroduced10_51 {
61+
@available(OSX, introduced: 99.51)
62+
class SubOtherIntroduced99_51 : OtherIntroduced99_51 {
6363
}
6464

65-
@available(OSX, introduced: 10.52)
66-
class OtherIntroduced10_52 : OtherIntroduced10_51 {
65+
@available(OSX, introduced: 99.52)
66+
class OtherIntroduced99_52 : OtherIntroduced99_51 {
6767
}
6868

69-
extension OtherIntroduced10_51 {
69+
extension OtherIntroduced99_51 {
7070
}
7171

7272
extension OtherIntroduced10_9 {
73-
@available(OSX, introduced: 10.51)
74-
func extensionMethodOnOtherIntroduced10_9AvailableOn10_51(_ p: OtherIntroduced10_51) { }
73+
@available(OSX, introduced: 99.51)
74+
func extensionMethodOnOtherIntroduced10_9AvailableOn99_51(_ p: OtherIntroduced99_51) { }
7575
}
7676

77-
@available(OSX, introduced: 10.51)
78-
extension OtherIntroduced10_51 {
79-
func extensionMethodOnOtherIntroduced10_51() { }
77+
@available(OSX, introduced: 99.51)
78+
extension OtherIntroduced99_51 {
79+
func extensionMethodOnOtherIntroduced99_51() { }
8080

81-
@available(OSX, introduced: 10.52)
82-
func extensionMethodOnOtherIntroduced10_51AvailableOn10_52() { }
81+
@available(OSX, introduced: 99.52)
82+
func extensionMethodOnOtherIntroduced99_51AvailableOn99_52() { }
8383
}
8484

85-
@available(OSX, introduced: 10.53)
86-
class OtherIntroduced10_53 {
85+
@available(OSX, introduced: 99.53)
86+
class OtherIntroduced99_53 {
8787
}
8888

89-
var globalFromOtherOn10_52 : OtherIntroduced10_52? = nil // expected-error {{'OtherIntroduced10_52' is only available in macOS 10.52 or newer}}
89+
var globalFromOtherOn99_52 : OtherIntroduced99_52? = nil // expected-error {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}}
9090
// expected-note@-1 {{add @available attribute to enclosing var}}

test/Sema/availability_versions_multi.swift

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,54 @@ callToEnsureNotInScriptMode() // expected-error {{expressions are not allowed at
88
@available(OSX, introduced: 10.9)
99
var globalAvailableOn10_9: Int = 9
1010

11-
@available(OSX, introduced: 10.51)
12-
var globalAvailableOn10_51: Int = 10
11+
@available(OSX, introduced: 99.51)
12+
var globalAvailableOn99_51: Int = 10
1313

14-
@available(OSX, introduced: 10.52)
15-
var globalAvailableOn10_52: Int = 11
14+
@available(OSX, introduced: 99.52)
15+
var globalAvailableOn99_52: Int = 11
1616

1717
// Top level should reflect the minimum deployment target.
1818
let ignored1: Int = globalAvailableOn10_9
1919

20-
let ignored2: Int = globalAvailableOn10_51 // expected-error {{'globalAvailableOn10_51' is only available in macOS 10.51 or newer}}
20+
let ignored2: Int = globalAvailableOn99_51 // expected-error {{'globalAvailableOn99_51' is only available in macOS 99.51 or newer}}
2121
// expected-note@-1 {{add @available attribute to enclosing let}}
2222

23-
let ignored3: Int = globalAvailableOn10_52 // expected-error {{'globalAvailableOn10_52' is only available in macOS 10.52 or newer}}
23+
let ignored3: Int = globalAvailableOn99_52 // expected-error {{'globalAvailableOn99_52' is only available in macOS 99.52 or newer}}
2424
// expected-note@-1 {{add @available attribute to enclosing let}}
2525

26-
@available(OSX, introduced: 10.51)
27-
func useFromOtherOn10_51() {
28-
// This will trigger validation of OtherIntroduced10_51 in
26+
@available(OSX, introduced: 99.51)
27+
func useFromOtherOn99_51() {
28+
// This will trigger validation of OtherIntroduced99_51 in
2929
// in availability_multi_other.swift
30-
let o10_51 = OtherIntroduced10_51()
31-
o10_51.extensionMethodOnOtherIntroduced10_51()
30+
let o99_51 = OtherIntroduced99_51()
31+
o99_51.extensionMethodOnOtherIntroduced99_51()
3232

3333
let o10_9 = OtherIntroduced10_9()
34-
o10_9.extensionMethodOnOtherIntroduced10_9AvailableOn10_51(o10_51)
35-
_ = o10_51.returns10_52Introduced10_52() // expected-error {{'returns10_52Introduced10_52()' is only available in macOS 10.52 or newer}}
34+
o10_9.extensionMethodOnOtherIntroduced10_9AvailableOn99_51(o99_51)
35+
_ = o99_51.returns99_52Introduced99_52() // expected-error {{'returns99_52Introduced99_52()' is only available in macOS 99.52 or newer}}
3636
// expected-note@-1 {{add 'if #available' version check}}
3737

38-
_ = OtherIntroduced10_52()
39-
// expected-error@-1 {{'OtherIntroduced10_52' is only available in macOS 10.52 or newer}}
38+
_ = OtherIntroduced99_52()
39+
// expected-error@-1 {{'OtherIntroduced99_52' is only available in macOS 99.52 or newer}}
4040
// expected-note@-2 {{add 'if #available' version check}}
4141

42-
o10_51.extensionMethodOnOtherIntroduced10_51AvailableOn10_52() // expected-error {{'extensionMethodOnOtherIntroduced10_51AvailableOn10_52()' is only available in macOS 10.52 or newer}}
42+
o99_51.extensionMethodOnOtherIntroduced99_51AvailableOn99_52() // expected-error {{'extensionMethodOnOtherIntroduced99_51AvailableOn99_52()' is only available in macOS 99.52 or newer}}
4343
// expected-note@-1 {{add 'if #available' version check}}
4444

45-
_ = OtherIntroduced10_51.NestedIntroduced10_52()
46-
// expected-error@-1 {{'NestedIntroduced10_52' is only available in macOS 10.52 or newer}}
45+
_ = OtherIntroduced99_51.NestedIntroduced99_52()
46+
// expected-error@-1 {{'NestedIntroduced99_52' is only available in macOS 99.52 or newer}}
4747
// expected-note@-2 {{add 'if #available' version check}}
4848
}
4949

50-
@available(OSX, introduced: 10.52)
51-
func useFromOtherOn10_52() {
52-
_ = OtherIntroduced10_52()
50+
@available(OSX, introduced: 99.52)
51+
func useFromOtherOn99_52() {
52+
_ = OtherIntroduced99_52()
5353

54-
let n10_52 = OtherIntroduced10_51.NestedIntroduced10_52()
55-
_ = n10_52.returns10_52()
56-
_ = n10_52.returns10_53() // expected-error {{'returns10_53()' is only available in macOS 10.53 or newer}}
54+
let n99_52 = OtherIntroduced99_51.NestedIntroduced99_52()
55+
_ = n99_52.returns99_52()
56+
_ = n99_52.returns99_53() // expected-error {{'returns99_53()' is only available in macOS 99.53 or newer}}
5757
// expected-note@-1 {{add 'if #available' version check}}
5858

5959
// This will trigger validation of the global in availability_in_multi_other.swift
60-
_ = globalFromOtherOn10_52
60+
_ = globalFromOtherOn99_52
6161
}

test/attr/attr_availability_canonical_macos_version.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %swift -typecheck -verify -parse-stdlib -module-name Swift -target x86_64-apple-macosx11.0 %s
2-
// RUN: %swift -typecheck -verify -parse-stdlib -module-name Swift -target x86_64-apple-macosx10.16 %s
32

43

54
@available(OSX, introduced: 10.5, deprecated: 10.8, obsoleted: 11.0,

0 commit comments

Comments
 (0)