================
@@ -0,0 +1,131 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios26.0 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos26.0 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple arm64-apple-tvos26.0 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macos26.0 
-darwin-target-variant-triple x86_64-apple-ios27.0-macabi -fsyntax-only -verify 
%s
+
+// Test @available and __builtin_available with anyAppleOS.
+
+// Declarations with anyAppleOS availability.
+void func_introduced_26(void) __attribute__((availability(anyAppleOS, 
introduced=26.0)));
+void func_introduced_27(void) __attribute__((availability(anyAppleOS, 
introduced=27.0))); // expected-note {{has been marked as being introduced in}}
+void func_deprecated_27(void) __attribute__((availability(anyAppleOS, 
introduced=26.0, deprecated=27.0)));
+void func_obsoleted_28(void) __attribute__((availability(anyAppleOS, 
introduced=26.0, obsoleted=28.0)));
+void func_unavailable(void) __attribute__((availability(anyAppleOS, 
unavailable))); // expected-note 2 {{has been explicitly marked unavailable 
here}}
----------------
ahatanak wrote:

Yes, it's legal. The one that has an explicit target OS has a higher priority 
than the one with anyAppleOS, so the latter gets dropped if the target OS is 
iOS or is aligned with iOS.

I added a test case for that to `attr-availability-anyappleos.c`.

https://github.com/llvm/llvm-project/pull/181953
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to