Files
swift-mirror/test/ClangModules/availability_watchos.swift
Devin Coughlin 4b23d4a219 Update clang importer and target platform detection for watchOS.
For the moment, we do not consider APIs deprecated earlier than watchOS 2.0 as
unavailable. rdar://problem/20948019 track changing this once the ultimate
decision on this policy has been made.

This addresses the compile-time components of rdar://problem/20774229

Swift SVN r28559
2015-05-14 04:20:43 +00:00

20 lines
737 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -I %S/Inputs/custom-modules %s
// REQUIRES: OS=watchos
import Foundation
import AvailabilityExtras
func test_unavailable_because_deprecated() {
// This is transcribed by clang to be deprecated on watchOS 2.0
// We don't currently treat these unavailable, but the policy decision
// hasn't been made yet.
// rdar://problem/20948019 tracks changing this, if needed, when the
// policy decision is made.
print(NSRealMemoryAvailable()) // expected-warning {{'NSRealMemoryAvailable()' was deprecated in watchOS 2.0}}
}
func test_swift_unavailable_wins() {
unavailableWithOS() // expected-error {{'unavailableWithOS()' is unavailable in Swift}}
}