2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / tls / struct-1.c
blob11151236d90716ffb5d54e29afa493560402c186
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" } */
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);
13 void
14 foo (struct S *s)
16 s->s2 = 231;
19 void
20 bar (void)
22 if (x.s0 == 231 || x.s2 != 231)
23 abort ();
26 int
27 main ()
29 foo (&x);
30 bar ();
31 exit (0);