2.13-1
[glibc.git] / elf / tst-tlsmod14a.c
blobad1d179aac2b0c5dd678871a36ae20996b156d41
1 #include <stdint.h>
2 #include <stdio.h>
4 #include <tls.h>
6 #if HAVE___THREAD
8 # define AL 4096
9 struct foo
11 int i;
12 } __attribute ((aligned (AL)));
14 static __thread struct foo f;
15 static struct foo g;
18 # ifndef FCT
19 # define FCT in_dso1
20 # endif
23 int
24 FCT (void)
26 puts (__func__);
28 int result = 0;
30 int fail = (((uintptr_t) &f) & (AL - 1)) != 0;
31 printf ("&f = %p %s\n", &f, fail ? "FAIL" : "OK");
32 result |= fail;
34 fail = (((uintptr_t) &g) & (AL - 1)) != 0;
35 printf ("&g = %p %s\n", &g, fail ? "FAIL" : "OK");
36 result |= fail;
38 return result;
41 #endif