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:
1.3 KB
|
Line | |
---|
1 | #include "tst-tls10.h"
|
---|
2 |
|
---|
3 | #ifdef USE_TLS__THREAD
|
---|
4 | __thread int dummy __attribute__((visibility ("hidden"))) = 12;
|
---|
5 | __thread struct A a1 = { 4, 5, 6 };
|
---|
6 | __thread struct A a3 __attribute__((tls_model("initial-exec")))
|
---|
7 | = { 10, 11, 12 };
|
---|
8 | extern __thread struct A a4 __attribute__((tls_model("initial-exec")));
|
---|
9 | static __thread struct A local1 = { 16, 17, 18 };
|
---|
10 | static __thread struct A local2 __attribute__((tls_model("initial-exec")))
|
---|
11 | = { 19, 20, 21 };
|
---|
12 |
|
---|
13 | void
|
---|
14 | check1 (void)
|
---|
15 | {
|
---|
16 | if (a1.a != 4 || a1.b != 5 || a1.c != 6)
|
---|
17 | abort ();
|
---|
18 | if (a2.a != 22 || a2.b != 23 || a2.c != 24)
|
---|
19 | abort ();
|
---|
20 | if (a3.a != 10 || a3.b != 11 || a3.c != 12)
|
---|
21 | abort ();
|
---|
22 | if (a4.a != 25 || a4.b != 26 || a4.c != 27)
|
---|
23 | abort ();
|
---|
24 | if (local1.a != 16 || local1.b != 17 || local1.c != 18)
|
---|
25 | abort ();
|
---|
26 | if (local2.a != 19 || local2.b != 20 || local2.c != 21)
|
---|
27 | abort ();
|
---|
28 | }
|
---|
29 |
|
---|
30 | struct A *
|
---|
31 | f1a (void)
|
---|
32 | {
|
---|
33 | return &a1;
|
---|
34 | }
|
---|
35 |
|
---|
36 | struct A *
|
---|
37 | f2a (void)
|
---|
38 | {
|
---|
39 | return &a2;
|
---|
40 | }
|
---|
41 |
|
---|
42 | struct A *
|
---|
43 | f3a (void)
|
---|
44 | {
|
---|
45 | return &a3;
|
---|
46 | }
|
---|
47 |
|
---|
48 | struct A *
|
---|
49 | f4a (void)
|
---|
50 | {
|
---|
51 | return &a4;
|
---|
52 | }
|
---|
53 |
|
---|
54 | struct A *
|
---|
55 | f5a (void)
|
---|
56 | {
|
---|
57 | return &local1;
|
---|
58 | }
|
---|
59 |
|
---|
60 | struct A *
|
---|
61 | f6a (void)
|
---|
62 | {
|
---|
63 | return &local2;
|
---|
64 | }
|
---|
65 |
|
---|
66 | int
|
---|
67 | f1b (void)
|
---|
68 | {
|
---|
69 | return a1.a;
|
---|
70 | }
|
---|
71 |
|
---|
72 | int
|
---|
73 | f2b (void)
|
---|
74 | {
|
---|
75 | return a2.b;
|
---|
76 | }
|
---|
77 |
|
---|
78 | int
|
---|
79 | f3b (void)
|
---|
80 | {
|
---|
81 | return a3.c;
|
---|
82 | }
|
---|
83 |
|
---|
84 | int
|
---|
85 | f4b (void)
|
---|
86 | {
|
---|
87 | return a4.a;
|
---|
88 | }
|
---|
89 |
|
---|
90 | int
|
---|
91 | f5b (void)
|
---|
92 | {
|
---|
93 | return local1.b;
|
---|
94 | }
|
---|
95 |
|
---|
96 | int
|
---|
97 | f6b (void)
|
---|
98 | {
|
---|
99 | return local2.c;
|
---|
100 | }
|
---|
101 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.