1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fPIC" } */
3 /* { dg-options "-O2 -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
4 /* { dg-require-effective-target tls } */
5 /* { dg-require-effective-target fpic } */
6
7 extern __thread int thr;
8
9 static int x;
10
11 static void
12 bar (void)
13 {
14 x = 1;
15 }
16
17 static void
18 #ifdef __i386__
19 __attribute__ ((regparm (3)))
20 #endif
21 foo (const char *x, void *y, int *z)
22 {
23 bar ();
24 }
25
26 void
27 test (const char *x, void *y)
28 {
29 foo (x, y, &thr);
30 }