Skip to content

Commit cfc7ff7

Browse files
committed
Fix test to use macOS 12.0 as the first OS to not require autolinking
instead of the notional 10.24, which the old logic in Platform.cpp accidentally treated as a future release with no runtime restrictions.
1 parent 3e4ce37 commit cfc7ff7

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

test/IRGen/autolink-runtime-compatibility.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// RUN: %target-swift-frontend -runtime-compatibility-version none -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
99

1010
// Doesn't autolink compatibility library because target OS doesn't need it
11-
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.24 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
11+
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx12.0 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=NO-FORCE-LOAD %s
1212

1313
// Only autolinks 5.1 compatibility library because target OS has 5.1
1414
// RUN: %target-swift-frontend -target %target-cpu-apple-macosx10.15 -emit-ir -parse-stdlib %s | %FileCheck -check-prefix=FORCE-LOAD-51 %s
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-swift-emit-silgen -disable-availability-checking %s | %FileCheck %s
2+
3+
// rdar://109904746
4+
5+
func foo<T>(_ makeT: () throws -> T = { throw Nope() }) rethrows -> T {
6+
try makeT()
7+
}
8+
9+
func bar<each T>() throws -> (repeat each T) {
10+
try foo() // compiler crash :(
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %target-swift-emit-silgen -disable-availability-checking %s | %FileCheck %s
2+
3+
// rdar://110391963
4+
5+
func identity<each Parameter>(_ parameter: repeat each Parameter) -> (repeat each Parameter) {
6+
return (repeat each parameter)
7+
}
8+
9+
[1, 2, 3].map(identity)
10+
11+
12+
13+
func test<each T>(tuple: (repeat each T, Int)) -> (repeat each T, Int?) {
14+
return tuple
15+
}
16+
17+
func test2<each T>(tuple: (repeat each T)) -> (repeat each T?) {
18+
return tuple
19+
}

0 commit comments

Comments
 (0)