mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Tests: Upstream missing contents of ClangImporter/availability_ios.swift.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify -verify-ignore-unrelated -I %S/Inputs/custom-modules -application-extension-library %s
|
||||
|
||||
// REQUIRES: OS=ios
|
||||
// UNSUPPORTED: OS=maccatalyst
|
||||
|
||||
import Foundation
|
||||
import AvailabilityExtras
|
||||
@@ -14,3 +15,25 @@ func test_unavailable_because_deprecated() {
|
||||
func test_swift_unavailable_wins() {
|
||||
unavailableWithOS() // expected-error {{'unavailableWithOS()' is unavailable in Swift}}
|
||||
}
|
||||
|
||||
|
||||
@available(iOS, introduced: 1.0)
|
||||
@available(macCatalyst, introduced: 1.0, obsoleted: 2.0)
|
||||
func obsoletedOnMacCatalystButNotIOS() { }
|
||||
|
||||
obsoletedOnMacCatalystButNotIOS() // no-error
|
||||
|
||||
@available(iOS, introduced: 1.0)
|
||||
@available(macCatalyst, introduced: 1.0, deprecated: 2.0)
|
||||
func deprecatedOnMacCatalystButNotIOS() { }
|
||||
|
||||
@available(iOS, introduced: 8.0)
|
||||
func maccatalyst_tests() {
|
||||
deprecatedOnMacCatalystButNotIOS() // no-warning
|
||||
|
||||
availableOnIOSButUnavailableOniOSAppExtension() // no-error
|
||||
availableOnIOSAppExtensionButUnavailableOnmacCatalystAppExtension() // no-error
|
||||
|
||||
availableOnIOSButDeprecatedOniOSAppExtension() // no-warning
|
||||
availableOnIOSAppExtensionButDeprecatedOnmacCatalystAppExtension() // no-warning
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user