1 /* Test C23 storage class specifiers in compound literals. Thread-local
2 cases, compilation tests. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c23 -pedantic-errors" } */
5 /* { dg-require-effective-target tls } */
9 /* thread_local is OK at file scope, although of limited use since the
10 thread-local object and its address are not constant expressions. */
11 size_t st
= sizeof (thread_local
int) { 1 };
12 size_t sst
= sizeof (static thread_local
int) { 1 };
17 return &(static thread_local
int) { 2 };
23 return &(thread_local
static int) { 3 };