<div dir="ltr">That's a good question. You'd have to ask someone from Apple :)<div><br></div><div>Those test cases were just copied from attr-availability-macosx.c. I figured it was better to leave them in case they were testing something generic rather than some specific Apple related bug.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 26, 2015 at 8:05 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Feb 26, 2015 at 9:41 PM, Dan Albert <<a href="mailto:danalbert@google.com">danalbert@google.com</a>> wrote:<br>
> Hi srhines,<br>
><br>
> REPOSITORY<br>
>   rL LLVM<br>
><br>
> <a href="http://reviews.llvm.org/D7929" target="_blank">http://reviews.llvm.org/D7929</a><br>
><br>
> Files:<br>
>   include/clang/Basic/Attr.td<br>
>   lib/Basic/Targets.cpp<br>
>   test/Sema/attr-availability-android.c<br>
><br>
> Index: include/clang/Basic/Attr.td<br>
> ===================================================================<br>
> --- include/clang/Basic/Attr.td<br>
> +++ include/clang/Basic/Attr.td<br>
> @@ -440,6 +440,7 @@<br>
>    let AdditionalMembers =<br>
>  [{static llvm::StringRef getPrettyPlatformName(llvm::StringRef Platform) {<br>
>      return llvm::StringSwitch<llvm::StringRef>(Platform)<br>
> +             .Case("android", "Android")<br>
>               .Case("ios", "iOS")<br>
>               .Case("macosx", "OS X")<br>
>               .Default(llvm::StringRef());<br>
> Index: lib/Basic/Targets.cpp<br>
> ===================================================================<br>
> --- lib/Basic/Targets.cpp<br>
> +++ lib/Basic/Targets.cpp<br>
> @@ -364,8 +364,13 @@<br>
>      DefineStd(Builder, "linux", Opts);<br>
>      Builder.defineMacro("__gnu_linux__");<br>
>      Builder.defineMacro("__ELF__");<br>
> -    if (Triple.getEnvironment() == llvm::Triple::Android)<br>
> +    if (Triple.getEnvironment() == llvm::Triple::Android) {<br>
>        Builder.defineMacro("__ANDROID__", "1");<br>
> +      unsigned Maj, Min, Rev;<br>
> +      Triple.getOSVersion(Maj, Min, Rev);<br>
> +      this->PlatformName = "android";<br>
> +      this->PlatformMinVersion = VersionTuple(Maj, Min, Rev);<br>
> +    }<br>
>      if (Opts.POSIXThreads)<br>
>        Builder.defineMacro("_REENTRANT");<br>
>      if (Opts.CPlusPlus)<br>
> Index: test/Sema/attr-availability-android.c<br>
> ===================================================================<br>
> --- /dev/null<br>
> +++ test/Sema/attr-availability-android.c<br>
> @@ -0,0 +1,31 @@<br>
> +// RUN: %clang_cc1 "-triple" "arm-linux-androideabi16" -fsyntax-only -verify %s<br>
> +<br>
> +void f0(int) __attribute__((availability(android,introduced=14,deprecated=19)));<br>
> +void f1(int) __attribute__((availability(android,introduced=16)));<br>
> +void f2(int) __attribute__((availability(android,introduced=14,deprecated=16))); // expected-note {{'f2' has been explicitly marked deprecated here}}<br>
> +void f3(int) __attribute__((availability(android,introduced=19)));<br>
> +void f4(int) __attribute__((availability(android,introduced=9,deprecated=11,obsoleted=16), availability(ios,introduced=2.0,deprecated=3.0))); // expected-note{{explicitly marked unavailable}}<br>
> +void f5(int) __attribute__((availability(ios,introduced=3.2), availability(android,unavailable))); // expected-note{{'f5' has been explicitly marked unavailable here}}<br>
> +<br>
> +void test() {<br>
> +  f0(0);<br>
> +  f1(0);<br>
> +  f2(0); // expected-warning{{'f2' is deprecated: first deprecated in Android 16}}<br>
> +  f3(0);<br>
> +  f4(0); // expected-error{{f4' is unavailable: obsoleted in Android 16}}<br>
> +  f5(0); // expected-error{{'f5' is unavailable: not available on Android}}<br>
> +}<br>
> +<br>
> +// rdar://10535640<br>
> +<br>
> +enum {<br>
> +    foo __attribute__((availability(android,introduced=8.0,deprecated=9.0)))<br>
> +};<br>
> +<br>
> +enum {<br>
> +    bar __attribute__((availability(android,introduced=8.0,deprecated=9.0))) = foo<br>
> +};<br>
> +<br>
> +enum __attribute__((availability(android,introduced=8.0,deprecated=9.0))) {<br>
> +    bar1 = foo<br>
> +};<br>
<br>
</div></div>What are the enum tests supposed to be testing? The rdar link isn't<br>
helpful for most folks.<br>
<br>
Otherwise, LGTM. Thanks!<br>
<br>
~Aaron<br>
<br>
><br>
> EMAIL PREFERENCES<br>
>   <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>