Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / tls / opt-1.c
blobf96bb676838cf8679a8cc8bef2af154e01c78fbb
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fPIC" } */
3 /* { dg-options "-O2 -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
4 /* { dg-require-effective-target tls_native } */
5 /* { dg-require-effective-target fpic } */
7 extern __thread int thr;
9 static int x;
11 static void
12 bar (void)
14 x = 1;
17 static void
18 #ifdef __i386__
19 __attribute__ ((regparm (3)))
20 #endif
21 foo (const char *x, void *y, int *z)
23 bar ();
26 void
27 test (const char *x, void *y)
29 foo (x, y, &thr);