]>
Commit | Line | Data |
---|---|---|
99fe3b0e UD |
1 | #include <stdint.h> |
2 | #include <stdio.h> | |
3 | ||
3ce1f295 | 4 | #define AL 4096 |
99fe3b0e UD |
5 | struct foo |
6 | { | |
7 | int i; | |
8 | } __attribute ((aligned (AL))); | |
9 | ||
10 | static __thread struct foo f; | |
11 | static struct foo g; | |
12 | ||
13 | ||
3ce1f295 UD |
14 | #ifndef FCT |
15 | # define FCT in_dso1 | |
16 | #endif | |
99fe3b0e UD |
17 | |
18 | ||
19 | int | |
20 | FCT (void) | |
21 | { | |
22 | puts (__func__); | |
23 | ||
24 | int result = 0; | |
25 | ||
26 | int fail = (((uintptr_t) &f) & (AL - 1)) != 0; | |
27 | printf ("&f = %p %s\n", &f, fail ? "FAIL" : "OK"); | |
28 | result |= fail; | |
29 | ||
30 | fail = (((uintptr_t) &g) & (AL - 1)) != 0; | |
31 | printf ("&g = %p %s\n", &g, fail ? "FAIL" : "OK"); | |
32 | result |= fail; | |
33 | ||
34 | return result; | |
35 | } |