Tests: Upstream missing contents of ClangImporter/availability_ios.swift.

This commit is contained in:
Allan Shortlidge
2025-10-16 15:49:10 -07:00
parent a07ea37d00
commit 62371b908b
2 changed files with 41 additions and 0 deletions

View File

@@ -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
}