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:
575 bytes
|
Line | |
---|
1 | #include <stdint.h>
|
---|
2 | #include <stdio.h>
|
---|
3 |
|
---|
4 | #include <tls.h>
|
---|
5 |
|
---|
6 | #if USE_TLS && HAVE___THREAD
|
---|
7 |
|
---|
8 | #define AL 4096
|
---|
9 | struct foo
|
---|
10 | {
|
---|
11 | int i;
|
---|
12 | } __attribute ((aligned (AL)));
|
---|
13 |
|
---|
14 | static __thread struct foo f;
|
---|
15 | static struct foo g;
|
---|
16 |
|
---|
17 |
|
---|
18 | #ifndef FCT
|
---|
19 | # define FCT in_dso1
|
---|
20 | #endif
|
---|
21 |
|
---|
22 |
|
---|
23 | int
|
---|
24 | FCT (void)
|
---|
25 | {
|
---|
26 | puts (__func__);
|
---|
27 |
|
---|
28 | int result = 0;
|
---|
29 |
|
---|
30 | int fail = (((uintptr_t) &f) & (AL - 1)) != 0;
|
---|
31 | printf ("&f = %p %s\n", &f, fail ? "FAIL" : "OK");
|
---|
32 | result |= fail;
|
---|
33 |
|
---|
34 | fail = (((uintptr_t) &g) & (AL - 1)) != 0;
|
---|
35 | printf ("&g = %p %s\n", &g, fail ? "FAIL" : "OK");
|
---|
36 | result |= fail;
|
---|
37 |
|
---|
38 | return result;
|
---|
39 | }
|
---|
40 |
|
---|
41 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.