mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This change introduces a new compilation target platform to the Swift compiler - visionOS. - Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target. - Addition of the new platform kind definition. - Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries. - Utilities to read out Darwin platform SDK info containing platform mapping data. - Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback'). - Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path. - Changes to existing test suite to accomodate the new platform.
20 lines
1.0 KiB
Swift
20 lines
1.0 KiB
Swift
// Mock SDK will contain an appropriate SDKSettings and a loadable stdlib
|
|
// RUN: %empty-directory(%t/mock-sdk)
|
|
// RUN: %empty-directory(%t/mock-sdk/usr/lib/swift)
|
|
// RUN: cp -r %test-resource-dir/xros/Swift.swiftmodule %t/mock-sdk/usr/lib/swift/Swift.swiftmodule
|
|
// RUN: cp %S/Inputs/mock-visionos-sdk/SDKSettings.json %t/mock-sdk/SDKSettings.json
|
|
// RUN: %swift -emit-sil -parse-as-library %s -target arm64-apple-xros1.0 -sdk %t/mock-sdk -I %t/mock-sdk/usr/lib/swift/ -verify
|
|
// RUN: %swift -emit-silgen -parse-as-library %s -target arm64-apple-xros1.0 -sdk %t/mock-sdk -I %t/mock-sdk/usr/lib/swift/ -o %t/ios_available_rawvalue_enum_on_visionos.sil
|
|
// RUN: %FileCheck %s < %t/ios_available_rawvalue_enum_on_visionos.sil
|
|
|
|
// REQUIRES: OS=xros
|
|
|
|
// CHECK-LABEL: // Metasyntactics.init(rawValue:)
|
|
// Ensure that OS version check is generated for the current platform
|
|
// CHECK: function_ref @$ss26_stdlib_isOSVersionAtLeastyBi1_Bw_BwBwtF
|
|
public enum Metasyntactics: String, RawRepresentable {
|
|
case foo
|
|
@available(visionOS 1.1, *)
|
|
case bar
|
|
}
|