Merge commit 'origin/master' into fedora/master
[glibc.git] / elf / tst-tlsmod8.c
blobc1822fc0cf1090c3597573114f5ed0babc6c8455
1 #include "tst-tls10.h"
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 };
12 void
13 check2 (void)
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 ();
25 struct A *
26 f7a (void)
28 return &a2;
31 struct A *
32 f8a (void)
34 return &a4;
37 struct A *
38 f9a (void)
40 return &local1;
43 struct A *
44 f10a (void)
46 return &local2;
49 int
50 f7b (void)
52 return a2.b;
55 int
56 f8b (void)
58 return a4.a;
61 int
62 f9b (void)
64 return local1.b;
67 int
68 f10b (void)
70 return local2.c;
72 #endif