Skip to content

Commit f9ed12d

Browse files
authored
Merge pull request #72716 from kubamracek/embedded-build-macos-as-14
[embedded] Build the macOS Embedded Stdlib with a recent deployment target
2 parents 5fcb321 + 611379e commit f9ed12d

11 files changed

+41
-14
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ if(SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB)
227227
)
228228
elseif (SWIFT_HOST_VARIANT STREQUAL "macosx")
229229
set(EMBEDDED_STDLIB_TARGET_TRIPLES ${EMBEDDED_STDLIB_TARGET_TRIPLES}
230-
"x86_64 x86_64-apple-macos x86_64-apple-macos10.13"
231-
"arm64 arm64-apple-macos arm64-apple-macos10.13"
232-
"arm64e arm64e-apple-macos arm64e-apple-macos10.13"
230+
"x86_64 x86_64-apple-macos x86_64-apple-macos14"
231+
"arm64 arm64-apple-macos arm64-apple-macos14"
232+
"arm64e arm64e-apple-macos arm64e-apple-macos14"
233233
)
234234
endif()
235235
endif()

test/DebugInfo/embedded.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that the "-enable-embedded-swift" is stored as a flag in the
22
// Compile Unit.
33

4-
// RUN: %target-swift-frontend -emit-ir -enable-experimental-feature Embedded -g %s -o - | %FileCheck %s
4+
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -emit-ir -enable-experimental-feature Embedded -g %s -o - | %FileCheck %s
55

66
// REQUIRES: swift_in_compiler
77
// REQUIRES: executable_test

test/IDE/complete_embedded.swift renamed to test/IDE/complete_embedded_linux.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: asserts
22
// REQUIRES: swift_in_compiler
3-
// REQUIRES: OS=macosx || OS=linux-gnu
3+
// REQUIRES: OS=linux-gnu
44
// RUN: %batch-code-completion -enable-experimental-feature Embedded
55

66
func test() {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// REQUIRES: asserts
2+
// REQUIRES: swift_in_compiler
3+
// REQUIRES: OS=macosx
4+
// RUN: %batch-code-completion -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded
5+
6+
func test() {
7+
#^GLOBAL^#
8+
// GLOBAL: Literal[Integer]/None: 0[#Int#];
9+
// GLOBAL: Literal[Boolean]/None: true[#Bool#];
10+
// GLOBAL: Literal[Boolean]/None: false[#Bool#];
11+
// GLOBAL: Literal[Nil]/None: nil;
12+
// GLOBAL: Literal[String]/None: "{#(abc)#}"[#String#];
13+
// GLOBAL: Literal[Array]/None: [{#(values)#}][#Array#];
14+
// GLOBAL: Literal[Dictionary]/None: [{#(key)#}: {#(value)#}][#Dictionary#];
15+
}

test/SILOptimizer/devirt_deinits.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
// RUN: %target-swift-frontend -primary-file %s -parse-as-library -sil-verify-all -Xllvm -enable-deinit-devirtualizer -module-name=test -emit-sil | %FileCheck %s
1+
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -primary-file %s -parse-as-library -sil-verify-all -Xllvm -enable-deinit-devirtualizer -module-name=test -emit-sil | %FileCheck %s
22

33
// Also do an end-to-end test and check if the compiled executable works as expected.
4-
// RUN: %target-run-simple-swift(-Xllvm -enable-deinit-devirtualizer -parse-as-library) | %FileCheck -check-prefix CHECK-OUTPUT %s
4+
// RUN: %target-run-simple-swift(-target %target-cpu-apple-macos14 -Xllvm -enable-deinit-devirtualizer -parse-as-library) | %FileCheck -check-prefix CHECK-OUTPUT %s
55

66
// Check if it works in embedded mode.
7-
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck -check-prefix CHECK-OUTPUT %s
7+
// RUN: %target-run-simple-swift(-target %target-cpu-apple-macos14 -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck -check-prefix CHECK-OUTPUT %s
88

99
// Run without the deinit-devirtualizer to verify that our CHECK-OUTPUT lines are correct.
1010
// TODO: currently disabled because of rdar://118449507
11-
// RUNx: %target-run-simple-swift(-Xllvm -sil-disable-pass=deinit-devirtualizer -parse-as-library) | %FileCheck -check-prefix CHECK-OUTPUT %s
11+
// RUNx: %target-run-simple-swift(-target %target-cpu-apple-macos14 -Xllvm -sil-disable-pass=deinit-devirtualizer -parse-as-library) | %FileCheck -check-prefix CHECK-OUTPUT %s
1212

1313

1414
// REQUIRES: swift_in_compiler

test/embedded/concurrency-actors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
2+
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
33
// RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
44
// RUN: %target-clang %t/a.o %t/print.o -o %t/a.out %swift_obj_root/lib/swift/embedded/%target-cpu-apple-macos/libswift_Concurrency.a -dead_strip
55
// RUN: %target-run %t/a.out | %FileCheck %s

test/embedded/concurrency-async-let.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
2+
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
33
// RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
44
// RUN: %target-clang %t/a.o %t/print.o -o %t/a.out %swift_obj_root/lib/swift/embedded/%target-cpu-apple-macos/libswift_Concurrency.a -dead_strip
55
// RUN: %target-run %t/a.out | %FileCheck %s

test/embedded/concurrency-builtins.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -emit-irgen %s -enable-experimental-feature Embedded -enable-builtin-module | %FileCheck %s
1+
// RUN: %target-swift-frontend -emit-irgen %s -enable-experimental-feature Embedded -enable-builtin-module | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44
// REQUIRES: optimized_stdlib

test/embedded/concurrency-simple.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
2+
// RUN: %target-swift-frontend -enable-experimental-feature Embedded -parse-as-library %s -c -o %t/a.o
33
// RUN: %target-clang -x c -c %S/Inputs/print.c -o %t/print.o
44
// RUN: %target-clang %t/a.o %t/print.o -o %t/a.out %swift_obj_root/lib/swift/embedded/%target-cpu-apple-macos/libswift_Concurrency.a -dead_strip
55
// RUN: %target-run %t/a.out | %FileCheck %s

test/embedded/lit.local.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Make a local copy of the substitutions.
2+
config.substitutions = list(config.substitutions)
3+
4+
if config.target_sdk_name == 'macosx':
5+
def do_fixup(key, value):
6+
if isinstance(value, str):
7+
value = value.replace("-apple-macosx10.13", "-apple-macos14")
8+
elif isinstance(value, SubstituteCaptures):
9+
value.substitution = value.substitution.replace("-apple-macosx10.13", "-apple-macos14")
10+
return (key, value)
11+
12+
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]

test/embedded/opaque-return-types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-ir %s -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded | %FileCheck %s
1+
// RUN: %target-swift-emit-ir %s -enable-experimental-feature Embedded | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44
// REQUIRES: VENDOR=apple

0 commit comments

Comments
 (0)