mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These are tests that fail in the next commit without this flag. This does not add -verify-ignore-unrelated to all tests with -verify, only the ones that would fail without it. This is NFC since this flag is currently a no-op.
39 lines
1.3 KiB
Swift
39 lines
1.3 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %empty-directory(%t/modules)
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %t/lib.swift \
|
|
// RUN: -emit-module-path %t/modules/lib.swiftmodule -module-name lib \
|
|
// RUN: -I %S/../Inputs/custom-modules/availability-domains \
|
|
// RUN: -enable-experimental-feature CustomAvailability
|
|
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %t/client.swift \
|
|
// RUN: -typecheck -verify -verify-ignore-unrelated \
|
|
// RUN: -I %S/../Inputs/custom-modules/availability-domains \
|
|
// RUN: -I %t/modules -enable-experimental-feature CustomAvailability
|
|
|
|
// REQUIRES: swift_feature_CustomAvailability
|
|
|
|
// https://github.com/swiftlang/swift/issues/80058
|
|
// UNSUPPORTED: OS=linux-android
|
|
|
|
//--- lib.swift
|
|
|
|
import Oceans // re-exports Rivers
|
|
|
|
@available(Pacific)
|
|
public func availableInPacific() { }
|
|
|
|
@available(Colorado, unavailable)
|
|
public func unavailableInColorado() { }
|
|
|
|
//--- client.swift
|
|
|
|
import lib
|
|
|
|
func test() { // expected-note {{add '@available' attribute to enclosing global function}}
|
|
availableInPacific() // expected-error {{'availableInPacific()' is only available in Pacific}}
|
|
// expected-note@-1 {{add 'if #available' version check}}
|
|
unavailableInColorado() // expected-error {{'unavailableInColorado()' is unavailable}}
|
|
}
|