OSDN Git Service

gcc/ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tls / struct-1.c
1 /* This testcase ICEd on IA-32 because the backend was inconsistent whether
2    to allow addends for @dtpoff relocs or not.  */
3 /* { dg-do compile } */
4 /* { dg-options "-O2 -fpic" } */
5
6 struct S {
7   int s0, s1, s2, s3;
8 };
9 static __thread struct S x;
10 extern void abort (void);
11 extern void exit (int);
12
13 void
14 foo (struct S *s)
15 {
16   s->s2 = 231;
17 }
18
19 void
20 bar (void)
21 {
22   if (x.s0 == 231 || x.s2 != 231)
23     abort ();
24 }
25
26 int
27 main ()
28 {
29   foo (&x);
30   bar ();
31   exit (0);
32 }