From ea266cad53e3d49771fa38103913d3ec7a166694 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 10 Jun 2013 20:45:12 +0000 Subject: Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3 release): http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502 --- test/PCH/thread-local.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/PCH/thread-local.cpp (limited to 'test/PCH/thread-local.cpp') diff --git a/test/PCH/thread-local.cpp b/test/PCH/thread-local.cpp new file mode 100644 index 0000000..f65c12a --- /dev/null +++ b/test/PCH/thread-local.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t +// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s + +#ifndef HEADER_INCLUDED + +#define HEADER_INCLUDED +extern thread_local int a; +extern _Thread_local int b; +extern int c; + +#else + +_Thread_local int a; // expected-error {{thread-local declaration of 'a' with static initialization follows declaration with dynamic initialization}} +// expected-note@7 {{previous declaration is here}} +thread_local int b; // expected-error {{thread-local declaration of 'b' with dynamic initialization follows declaration with static initialization}} +// expected-note@8 {{previous declaration is here}} +thread_local int c; // expected-error {{thread-local declaration of 'c' follows non-thread-local declaration}} +// expected-note@9 {{previous declaration is here}} + +#endif -- cgit v1.1