* elf/tst-tls12.c (main): Fix declaration.
[platform/upstream/glibc.git] / elf / tst-tlsmod8.c
1 #include "tst-tls10.h"
2
3 #ifdef USE_TLS__THREAD
4 __thread long long dummy __attribute__((visibility ("hidden"))) = 12;
5 __thread struct A a2 = { 22, 23, 24 };
6 __thread struct A a4 __attribute__((tls_model("initial-exec")))
7   = { 25, 26, 27 };
8 static __thread struct A local1 = { 28, 29, 30 };
9 static __thread struct A local2 __attribute__((tls_model("initial-exec")))
10   = { 31, 32, 33 };
11
12 void
13 check2 (void)
14 {
15   if (a2.a != 22 || a2.b != 23 || a2.c != 24)
16     abort ();
17   if (a4.a != 25 || a4.b != 26 || a4.c != 27)
18     abort ();
19   if (local1.a != 28 || local1.b != 29 || local1.c != 30)
20     abort ();
21   if (local2.a != 31 || local2.b != 32 || local2.c != 33)
22     abort ();
23 }
24
25 struct A *
26 f7a (void)
27 {
28   return &a2;
29 }
30
31 struct A *
32 f8a (void)
33 {
34   return &a4;
35 }
36
37 struct A *
38 f9a (void)
39 {
40   return &local1;
41 }
42
43 struct A *
44 f10a (void)
45 {
46   return &local2;
47 }
48
49 int
50 f7b (void)
51 {
52   return a2.b;
53 }
54
55 int
56 f8b (void)
57 {
58   return a4.a;
59 }
60
61 int
62 f9b (void)
63 {
64   return local1.b;
65 }
66
67 int
68 f10b (void)
69 {
70   return local2.c;
71 }
72 #endif