S390: Add new s390 platform.
[glibc.git] / elf / tst-tlsmod9.c
blob6b11ed58b861dc5a47fd99f4bc359cd3e2c91354
1 #include "tst-tls10.h"
3 __thread int dummy __attribute__((visibility ("hidden"))) = 12;
4 __thread struct A a1 = { 4, 5, 6 };
5 __thread struct A a3 __attribute__((tls_model("initial-exec")))
6 = { 10, 11, 12 };
7 extern __thread struct A a4 __attribute__((tls_model("initial-exec")));
8 static __thread struct A local1 = { 16, 17, 18 };
9 static __thread struct A local2 __attribute__((tls_model("initial-exec")))
10 = { 19, 20, 21 };
12 void
13 check1 (void)
15 if (a1.a != 4 || a1.b != 5 || a1.c != 6)
16 abort ();
17 if (a2.a != 22 || a2.b != 23 || a2.c != 24)
18 abort ();
19 if (a3.a != 10 || a3.b != 11 || a3.c != 12)
20 abort ();
21 if (a4.a != 25 || a4.b != 26 || a4.c != 27)
22 abort ();
23 if (local1.a != 16 || local1.b != 17 || local1.c != 18)
24 abort ();
25 if (local2.a != 19 || local2.b != 20 || local2.c != 21)
26 abort ();
29 struct A *
30 f1a (void)
32 return &a1;
35 struct A *
36 f2a (void)
38 return &a2;
41 struct A *
42 f3a (void)
44 return &a3;
47 struct A *
48 f4a (void)
50 return &a4;
53 struct A *
54 f5a (void)
56 return &local1;
59 struct A *
60 f6a (void)
62 return &local2;
65 int
66 f1b (void)
68 return a1.a;
71 int
72 f2b (void)
74 return a2.b;
77 int
78 f3b (void)
80 return a3.c;
83 int
84 f4b (void)
86 return a4.a;
89 int
90 f5b (void)
92 return local1.b;
95 int
96 f6b (void)
98 return local2.c;