1 /* Test C2x storage class specifiers in compound literals. Thread-local
2 cases, execution tests. */
4 /* { dg-options "-pthread -std=gnu2x -pedantic-errors" } */
5 /* { dg-require-effective-target pthread_h } */
6 /* { dg-require-effective-target pthread } */
7 /* { dg-require-effective-target tls_runtime } */
8 /* { dg-add-options tls } */
12 extern void abort (void);
13 extern void exit (int);
18 return (static thread_local int []) { 1, 2 };
21 int *volatile p, *volatile q, r;
27 if (q[0] != 1 || q[1] != 2)
41 if (p[0] != 1 || p[1] != 2)
45 if (p != thread_addr ())
47 i = pthread_create (&tid, NULL, thread_fn, NULL);
48 if (p != thread_addr ())
50 i = pthread_join (tid, &ret);
55 if (p != thread_addr ())
57 if (p[0] != 3 || p[1] != 4)