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

source code of glibc/elf/tst-tlsmod8.c