1 // RUN: %clang_cc1 -fsyntax-only -std=c23 %s -verify
3 // Ensure that thread_local and _Thread_local are synonyms in C23 and both
4 // restrict local variables to be explicitly static or extern.
6 // FIXME: it would be nice if the diagnostic said 'thread_local' in this case.
7 thread_local
int i
= 12; // expected-error {{'_Thread_local' variables must have global storage}}
8 _Thread_local
int j
= 13; // expected-error {{'_Thread_local' variables must have global storage}}
10 static thread_local
int k
= 14;
11 static _Thread_local
int l
= 15;
13 extern thread_local
int m
;
14 extern thread_local
int n
;
17 // This would previously fail because the tls models were different.
18 extern thread_local
unsigned a
;
19 _Thread_local
unsigned a
= 0;