llvm-project/clang/test/CodeGen/attr-availability-aligned-versions.c
Cyndy Ishida 88f041f3e0
[clang][Darwin] Align all OS Versions for 26 (#143548)
* Translate the following versions to 26.
  * watchOS 12 -> 26
  * visionOS 3 -> 26
  * macos 16 -> 26
  * iOS 19 -> 26
  * tvOS 19 -> 26

* Emit diagnostics, but allow conversion when clients attempt to use
invalid gaps in OS versioning in availability.

* For target-triples, only allow "valid" versions for implicit
conversions.
2025-06-10 09:50:46 -07:00

29 lines
991 B
C

/// This test verifies IR generated for APIs protected with availability annotations with a common versions.
// RUN: %clang_cc1 -fvisibility=hidden "-triple" "arm64-apple-ios26.0" -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fvisibility=hidden "-triple" "arm64-apple-tvos26" -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fvisibility=hidden "-triple" "arm64-apple-watchos26" -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fvisibility=hidden "-triple" "arm64-apple-ios18" -emit-llvm -o - %s | FileCheck -check-prefix=OLD %s
__attribute__((availability(ios,introduced=19)))
void f0(void);
__attribute__((availability(ios,introduced=26)))
void f1(void);
__attribute__((availability(ios,introduced=27)))
void f2(void);
// OLD: declare extern_weak void @f0
// OLD: declare extern_weak void @f1
// OLD: declare extern_weak void @f2
// CHECK: declare void @f0
// CHECK: declare void @f1
// CHECK: declare extern_weak void @f2
void test() {
f0();
f1();
f2();
}