Files
swift-mirror/test/SourceKit/InterfaceGen/gen_vision_availability.swift
Artem Chikin 1f14158a1d Introduce VisionOS Platform
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.
2024-04-10 09:38:02 -07:00

40 lines
1.6 KiB
Swift

// REQUIRES: concurrency
// RUN: %empty-directory(%t)
// RUN: %sourcekitd-test -req=interface-gen %s -- %s -target %target-triple -module-name MyModule | %FileCheck %s --check-prefix=SWIFTSOURCE
// RUN: %target-swift-frontend -emit-module -module-name MyModule -o %t/MyModule.swiftmodule %s
// RUN: %sourcekitd-test -req=interface-gen -module MyModule -- -target %target-triple -I %t | %FileCheck %s --check-prefix=SWIFTMODULE
// RUN: %sourcekitd-test -req=doc-info -module MyModule -- -target %target-triple -I %t | %FileCheck %s --check-prefix=DOCINFO
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
public struct SomeStruct {}
public struct TestStruct {
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
public func availableMethod() {}
}
// SWIFTSOURCE: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
// SWIFTSOURCE: public struct SomeStruct {
// SWIFTSOURCE: }
// SWIFTSOURCE: public struct TestStruct {
// SWIFTSOURCE: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
// SWIFTSOURCE: public func availableMethod()
// SWIFTSOURCE: }
// SWIFTMODULE: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
// SWIFTMODULE: public struct SomeStruct {
// SWIFTMODULE: }
// SWIFTMODULE: public struct TestStruct {
// SWIFTMODULE: @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, visionOS 1.0, *)
// SWIFTMODULE: public func availableMethod()
// SWIFTMODULE: }
// DOCINFO: struct SomeStruct {
// DOCINFO: }
// DOCINFO: struct TestStruct {
// DOCINFO: func availableMethod()
// DOCINFO: }