mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Specifically, this is about the /version/ of the running OS. Previously, this was only autodetected for the interpreter, with the compiler defaulting to the earliest version of macOS supported by Swift (10.9); picking the current running OS seems more useful. LLVM changed their default behavior recently, so this doesn't actually require any implementation changes. This only affects macOS today, because it only affects compiling without an explicit target (i.e. not cross-compiling) on an OS with cross-version binary compatibility (i.e. not Linux). rdar://problem/29948658
19 lines
703 B
Swift
19 lines
703 B
Swift
// Note: This is deliberately testing the target-less invocation of swift(c).
|
|
|
|
// RUN: %swiftc_driver -typecheck -import-objc-header %S/Inputs/availability_host_os.h -DFAIL -Xfrontend -verify %s
|
|
// RUN: %swift_driver -import-objc-header %S/Inputs/availability_host_os.h -DFAIL -Xfrontend -verify %s
|
|
|
|
// RUN: %swift_driver -import-objc-header %S/Inputs/availability_host_os.h %s | %FileCheck %s
|
|
|
|
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: executable_test
|
|
|
|
print(mavericks()) // CHECK: {{^9$}}
|
|
print(yosemite()) // CHECK-NEXT: {{^10$}}
|
|
|
|
#if FAIL
|
|
print(todosSantos()) // expected-error {{'todosSantos()' is only available on OS X 10.99 or newer}}
|
|
// expected-note@-1 {{add 'if #available' version check}}
|
|
#endif
|