source: vendor/glibc-tests/glibc/elf/tst-tlsmod8.c

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1002 bytes
Line 
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 };
8static __thread struct A local1 = { 28, 29, 30 };
9static __thread struct A local2 __attribute__((tls_model("initial-exec")))
10 = { 31, 32, 33 };
11
12void
13check2 (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
25struct A *
26f7a (void)
27{
28 return &a2;
29}
30
31struct A *
32f8a (void)
33{
34 return &a4;
35}
36
37struct A *
38f9a (void)
39{
40 return &local1;
41}
42
43struct A *
44f10a (void)
45{
46 return &local2;
47}
48
49int
50f7b (void)
51{
52 return a2.b;
53}
54
55int
56f8b (void)
57{
58 return a4.a;
59}
60
61int
62f9b (void)
63{
64 return local1.b;
65}
66
67int
68f10b (void)
69{
70 return local2.c;
71}
72#endif
Note: See TracBrowser for help on using the repository browser.