]> git.ipfire.org Git - thirdparty/glibc.git/blame - elf/tst-tlsmod14a.c
[BZ #2510, BZ #2830, BZ #3137, BZ #3313, BZ #3426, BZ #3465, BZ #3480, BZ #3483,...
[thirdparty/glibc.git] / elf / tst-tlsmod14a.c
CommitLineData
99fe3b0e
UD
1#include <stdint.h>
2#include <stdio.h>
3
23195635
RM
4#include <tls.h>
5
11bf311e 6#if HAVE___THREAD
99fe3b0e 7
11bf311e 8# define AL 4096
99fe3b0e
UD
9struct foo
10{
11 int i;
12} __attribute ((aligned (AL)));
13
14static __thread struct foo f;
15static struct foo g;
16
17
11bf311e
UD
18# ifndef FCT
19# define FCT in_dso1
20# endif
99fe3b0e
UD
21
22
23int
24FCT (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}
23195635
RM
40
41#endif