<div dir="ltr">I don't think this is obvious, since we reduce test coverage either way (if we XFAIL, we don't test some hosts, and if we set a triple we only test one target). For other tests I've been specifying an explicit triple, so we at least exercise the code when built for darwin10; I think I have a slight preference for that.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 10:04 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah, I've "Fixed" it at the moment. Have no opinion whether or not<br>
XFAILing it or just setting some arbitrary triple for the test is most<br>
useful. Thoughts?<br>
<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Wed, Apr 17, 2013 at 5:06 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> Thanks Eric for fixing this! Sorry this slipped my notice... WG21 has been<br>
> busy.<br>
><br>
><br>
> On Tue, Apr 16, 2013 at 5:48 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Apr 15, 2013 at 11:29 AM, David Dean <<a href="mailto:david_dean@apple.com">david_dean@apple.com</a>> wrote:<br>
>> > Richard,<br>
>> >         Can you XFAIL SemaCXX/cxx11-thread-local.cpp on darwin10? It's<br>
>> > passing on darwin11, but not darwin10. My understanding is that this is<br>
>> > expected.<br>
>><br>
>> Still seeing this<br>
>> <a href="http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb" target="_blank">http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb</a><br>
>><br>
>> ><br>
>> > On 15 Apr 2013, at 1:33 AM, Richard Smith <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>><br>
>> > wrote:<br>
>> ><br>
>> >> Author: rsmith<br>
>> >> Date: Mon Apr 15 03:33:22 2013<br>
>> >> New Revision: 179517<br>
>> >><br>
>> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=179517&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=179517&view=rev</a><br>
>> >> Log:<br>
>> >> Local thread_local variables are implicitly 'static'. (This doesn't<br>
>> >> apply to _Thread_local nor __thread.)<br>
>> >><br>
>> >> Added:<br>
>> >>    cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp<br>
>> >> Modified:<br>
>> >>    cfe/trunk/lib/Sema/SemaDecl.cpp<br>
>> >>    cfe/trunk/test/Sema/thread-specifier.c<br>
>> >><br>
>> >> Modified: cfe/trunk/lib/Sema/SemaDecl.cpp<br>
>> >> URL:<br>
>> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=179517&r1=179516&r2=179517&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=179517&r1=179516&r2=179517&view=diff</a><br>

>> >><br>
>> >> ==============================================================================<br>
>> >> --- cfe/trunk/lib/Sema/SemaDecl.cpp (original)<br>
>> >> +++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Apr 15 03:33:22 2013<br>
>> >> @@ -4687,8 +4687,7 @@ Sema::ActOnVariableDeclarator(Scope *S,<br>
>> >>          "Parser allowed 'typedef' as storage class VarDecl.");<br>
>> >>   VarDecl::StorageClass SC =<br>
>> >> StorageClassSpecToVarDeclStorageClass(SCSpec);<br>
>> >><br>
>> >> -  if (getLangOpts().OpenCL && !getOpenCLOptions().cl_khr_fp16)<br>
>> >> -  {<br>
>> >> +  if (getLangOpts().OpenCL && !getOpenCLOptions().cl_khr_fp16) {<br>
>> >>     // OpenCL v1.2 s6.1.1.1: reject declaring variables of the half and<br>
>> >>     // half array type (unless the cl_khr_fp16 extension is enabled).<br>
>> >>     if (Context.getBaseElementType(R)->isHalfType()) {<br>
>> >> @@ -4705,6 +4704,16 @@ Sema::ActOnVariableDeclarator(Scope *S,<br>
>> >>     SC = SC_None;<br>
>> >>   }<br>
>> >><br>
>> >> +  // C++11 [dcl.stc]p4:<br>
>> >> +  //   When thread_local is applied to a variable of block scope the<br>
>> >> +  //   storage-class-specifier static is implied if it does not appear<br>
>> >> +  //   explicitly.<br>
>> >> +  // Core issue: 'static' is not implied if the variable is declared<br>
>> >> 'extern'.<br>
>> >> +  if (SCSpec == DeclSpec::SCS_unspecified &&<br>
>> >> +      D.getDeclSpec().getThreadStorageClassSpec() ==<br>
>> >> +          DeclSpec::TSCS_thread_local && DC->isFunctionOrMethod())<br>
>> >> +    SC = SC_Static;<br>
>> >> +<br>
>> >>   IdentifierInfo *II = Name.getAsIdentifierInfo();<br>
>> >>   if (!II) {<br>
>> >>     Diag(D.getIdentifierLoc(), diag::err_bad_variable_name)<br>
>> >><br>
>> >> Modified: cfe/trunk/test/Sema/thread-specifier.c<br>
>> >> URL:<br>
>> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/thread-specifier.c?rev=179517&r1=179516&r2=179517&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/thread-specifier.c?rev=179517&r1=179516&r2=179517&view=diff</a><br>

>> >><br>
>> >> ==============================================================================<br>
>> >> --- cfe/trunk/test/Sema/thread-specifier.c (original)<br>
>> >> +++ cfe/trunk/test/Sema/thread-specifier.c Mon Apr 15 03:33:22 2013<br>
>> >> @@ -42,8 +42,6 @@ int f(__thread int t7) { // expected-err<br>
>> >>   // expected-error@-2 {{'__thread' variables must have global<br>
>> >> storage}}<br>
>> >> #elif defined(C11)<br>
>> >>   // expected-error@-4 {{'_Thread_local' variables must have global<br>
>> >> storage}}<br>
>> >> -#else<br>
>> >> -  // expected-error@-6 {{'thread_local' variables must have global<br>
>> >> storage}}<br>
>> >> #endif<br>
>> >>   extern __thread int t9;<br>
>> >>   static __thread int t10;<br>
>> >> @@ -51,9 +49,9 @@ int f(__thread int t7) { // expected-err<br>
>> >> #if __cplusplus < 201103L<br>
>> >>   __thread auto int t12a; // expected-error-re {{cannot combine with<br>
>> >> previous '(__thread|_Thread_local)' declaration specifier}}<br>
>> >>   auto __thread int t12b; // expected-error {{cannot combine with<br>
>> >> previous 'auto' declaration specifier}}<br>
>> >> -#else<br>
>> >> -  __thread auto t12a = 0; // expected-error-re {{'(t|_T)hread_local'<br>
>> >> variables must have global storage}}<br>
>> >> -  auto __thread t12b = 0; // expected-error-re {{'(t|_T)hread_local'<br>
>> >> variables must have global storage}}<br>
>> >> +#elif !defined(CXX11)<br>
>> >> +  __thread auto t12a = 0; // expected-error-re {{'_Thread_local'<br>
>> >> variables must have global storage}}<br>
>> >> +  auto __thread t12b = 0; // expected-error-re {{'_Thread_local'<br>
>> >> variables must have global storage}}<br>
>> >> #endif<br>
>> >>   __thread register int t13a; // expected-error-re {{cannot combine<br>
>> >> with previous '(__thread|_Thread_local|thread_local)' declaration<br>
>> >> specifier}}<br>
>> >>   register __thread int t13b; // expected-error {{cannot combine with<br>
>> >> previous 'register' declaration specifier}}<br>
>> >><br>
>> >> Added: cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp<br>
>> >> URL:<br>
>> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp?rev=179517&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp?rev=179517&view=auto</a><br>

>> >><br>
>> >> ==============================================================================<br>
>> >> --- cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp (added)<br>
>> >> +++ cfe/trunk/test/SemaCXX/cxx11-thread-local.cpp Mon Apr 15 03:33:22<br>
>> >> 2013<br>
>> >> @@ -0,0 +1,23 @@<br>
>> >> +// RUN: %clang_cc1 -std=c++11 -verify %s<br>
>> >> +<br>
>> >> +struct S {<br>
>> >> +  static thread_local int a;<br>
>> >> +  static int b; // expected-note {{here}}<br>
>> >> +  thread_local int c; // expected-error {{'thread_local' is only<br>
>> >> allowed on variable declarations}}<br>
>> >> +  static thread_local int d; // expected-note {{here}}<br>
>> >> +};<br>
>> >> +<br>
>> >> +thread_local int S::a;<br>
>> >> +thread_local int S::b; // expected-error {{thread-local declaration of<br>
>> >> 'b' follows non-thread-local declaration}}<br>
>> >> +thread_local int S::c; // expected-error {{non-static data member<br>
>> >> defined out-of-line}}<br>
>> >> +int S::d; // expected-error {{non-thread-local declaration of 'd'<br>
>> >> follows thread-local declaration}}<br>
>> >> +<br>
>> >> +thread_local int x[3];<br>
>> >> +thread_local int y[3];<br>
>> >> +thread_local int z[3]; // expected-note {{previous}}<br>
>> >> +<br>
>> >> +void f() {<br>
>> >> +  thread_local int x;<br>
>> >> +  static thread_local int y;<br>
>> >> +  extern thread_local int z; // expected-error {{redefinition of 'z'<br>
>> >> with a different type}}<br>
>> >> +}<br>
>> >><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>
>> > -David<br>
>> ><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>
</div></div></blockquote></div><br></div>