Files
swift-mirror/test/Availability/availability_enum_case.swift
Allan Shortlidge 897a74f495 Tests: Move some availability tests into a new test/Availability directory.
Un-reverts 9c01ee2c1b.

Also, add myself as a reviewer for more availability related files.

NFC.
2025-06-23 15:57:34 -07:00

20 lines
951 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-module %S/Inputs/availability_enum_case_other.swift -target %target-cpu-apple-macosx50 -emit-module-interface-path %t/availability_enum_case_other.swiftinterface -swift-version 5 -enable-library-evolution
// RUN: %target-typecheck-verify-swift -I %t
// RUN: %target-build-swift -emit-module %S/Inputs/availability_enum_case_other.swift -target %target-cpu-apple-macosx50 -emit-module-interface-path %t/availability_enum_case_other.swiftinterface -swift-version 5 -enable-library-evolution -whole-module-optimization
// RUN: %target-typecheck-verify-swift -I %t
// REQUIRES: OS=macosx
import availability_enum_case_other
func ride(horse: Horse) {
// expected-note@-1 {{add '@available' attribute to enclosing global function}}
_ = Horse.kevin
// expected-error@-1 {{'kevin' is only available in macOS 50 or newer}}
// expected-note@-2 {{add 'if #available' version check}}
}