PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / noplt-gd-2.c
blob81c8446a11276e65f831b44bd46c430f9590c1b7
1 /* { dg-do run { target *-*-linux* } } */
2 /* { dg-options "-O2 -fpic -fno-plt" } */
3 /* { dg-additional-sources noplt-gd-1.c } */
5 __thread int gd = 1;
6 extern void abort (void);
7 extern int * get_gd (void);
8 extern void set_gd (int);
9 extern int test_gd (int);
11 int
12 main ()
14 int *p;
16 if (gd != 1)
17 abort ();
19 p = get_gd ();
20 if (*p != gd)
21 abort ();
23 set_gd (4);
24 if (*p != 4 || !test_gd (4))
25 abort ();
27 return 0;