| 1 |
// This validates that all expected OSVersions that allow fallbacks |
| 2 |
// from iOS behave as expected against a common version bump. |
| 3 |
|
| 4 |
// RUN: %clang_cc1 "-triple" "arm64-apple-ios26" -fsyntax-only -verify %s |
| 5 |
// RUN: %clang_cc1 "-triple" "arm64-apple-watchos26" -fsyntax-only -verify %s |
| 6 |
// RUN: %clang_cc1 "-triple" "arm64-apple-tvos26" -fsyntax-only -verify %s |
| 7 |
|
| 8 |
// VisionOS requires SDKSettings support to enable remappings. |
| 9 |
// RUN: %clang_cc1 "-triple" "arm64-apple-visionos26" -isysroot %S/Inputs/XROS.sdk -fsyntax-only -verify %s |
| 10 |
|
| 11 |
// expected-no-diagnostics |
| 12 |
|
| 13 |
__attribute__((availability(ios,strict,introduced=19))) |
| 14 |
int iOSExistingAPI(void); |
| 15 |
|
| 16 |
__attribute__((availability(ios,strict,introduced=26))) |
| 17 |
int iOSExistingAPI2(void); |
| 18 |
|
| 19 |
void testAvailabilityCheck(void) { |
| 20 |
|
| 21 |
if (__builtin_available(iOS 19, *)) { |
| 22 |
iOSExistingAPI(); |
| 23 |
iOSExistingAPI2(); |
| 24 |
} |
| 25 |
|
| 26 |
if (__builtin_available(iOS 26, *)) { |
| 27 |
iOSExistingAPI(); |
| 28 |
iOSExistingAPI2(); |
| 29 |
} |
| 30 |
|
| 31 |
iOSExistingAPI2(); |
| 32 |
} |