libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu23-complit-2.c
blob4f36d81eaf715da92c4ebc27a99902fde0f85153
1 /* Test C23 storage class specifiers in compound literals. Thread-local
2 cases, compilation tests, GNU __thread used. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu23" } */
5 /* { dg-require-effective-target tls } */
7 #include <stddef.h>
9 /* __thread 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 int) { 1 };
12 size_t sst = sizeof (static __thread int) { 1 };
14 int *
15 f ()
17 return &(static __thread int) { 2 };