Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / gnu2x-complit-2.c
blob20cb38fd94ed5dc40f5c746961afabb67ca6c1ac
1 /* Test C2x storage class specifiers in compound literals. Thread-local
2 cases, compilation tests, GNU __thread used. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=gnu2x" } */
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 };