Richard Smith | b16ae8b | 2013-04-15 08:00:15 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t |
| 2 | // RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s |
Richard Smith | 38afbc7 | 2013-04-13 02:43:54 +0000 | [diff] [blame] | 3 | |
| 4 | #ifndef HEADER_INCLUDED |
| 5 | |
| 6 | #define HEADER_INCLUDED |
| 7 | extern thread_local int a; |
| 8 | extern _Thread_local int b; |
| 9 | extern int c; |
| 10 | |
| 11 | #else |
| 12 | |
| 13 | _Thread_local int a; // expected-error {{thread-local declaration of 'a' with static initialization follows declaration with dynamic initialization}} |
| 14 | // expected-note@7 {{previous declaration is here}} |
| 15 | thread_local int b; // expected-error {{thread-local declaration of 'b' with dynamic initialization follows declaration with static initialization}} |
| 16 | // expected-note@8 {{previous declaration is here}} |
| 17 | thread_local int c; // expected-error {{thread-local declaration of 'c' follows non-thread-local declaration}} |
| 18 | // expected-note@9 {{previous declaration is here}} |
| 19 | |
| 20 | #endif |