1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-require-effective-target tls } */
5 extern void abort (void);
6 extern void exit (int);
14 extern __thread
struct A a1
, a2
, a3
, a4
;
15 extern struct A
*f1a (void);
16 extern struct A
*f2a (void);
17 extern struct A
*f3a (void);
18 extern struct A
*f4a (void);
19 extern struct A
*f5a (void);
20 extern struct A
*f6a (void);
21 extern struct A
*f7a (void);
22 extern struct A
*f8a (void);
23 extern struct A
*f9a (void);
24 extern struct A
*f10a (void);
25 extern int f1b (void);
26 extern int f2b (void);
27 extern int f3b (void);
28 extern int f4b (void);
29 extern int f5b (void);
30 extern int f6b (void);
31 extern int f7b (void);
32 extern int f8b (void);
33 extern int f9b (void);
34 extern int f10b (void);
35 extern void check1 (void);
36 extern void check2 (void);
37 __thread
int dummy
= 12;
38 __thread
struct A local
= { 1, 2, 3 };
45 if (local
.a
!= 1 || local
.b
!= 2 || local
.c
!= 3)
47 if (a1
.a
!= 4 || a1
.b
!= 5 || a1
.c
!= 6)
49 if (a2
.a
!= 22 || a2
.b
!= 23 || a2
.c
!= 24)
51 if (a3
.a
!= 10 || a3
.b
!= 11 || a3
.c
!= 12)
53 if (a4
.a
!= 25 || a4
.b
!= 26 || a4
.c
!= 27)
57 if (f1a () != &a1
|| f2a () != &a2
|| f3a () != &a3
|| f4a () != &a4
)
59 p
= f5a (); if (p
->a
!= 16 || p
->b
!= 16 + 1 || p
->c
!= 16 + 2)
61 p
= f6a (); if (p
->a
!= 19 || p
->b
!= 19 + 1 || p
->c
!= 19 + 2)
63 if (f7a () != &a2
|| f8a () != &a4
)
65 p
= f9a (); if (p
->a
!= 28 || p
->b
!= 28 + 1 || p
->c
!= 28 + 2)
67 p
= f10a (); if (p
->a
!= 31 || p
->b
!= 31 + 1 || p
->c
!= 31 + 2)