add test for strftime
[libc-test.git] / src / functional / tls_align_dlopen.c
blob77a7b9372172217782cd8d5dcdeaafc990fc73b6
1 #include <dlfcn.h>
2 #include "test.h"
4 int main()
6 int i;
7 void *h;
8 struct {
9 char *name;
10 unsigned size;
11 unsigned align;
12 unsigned long addr;
13 } *t;
15 h = dlopen("src/functional/tls_align_dso.so", RTLD_LAZY);
16 if (!h)
17 t_error("dlopen failed\n");
18 t = dlsym(h, "t");
19 if (!t)
20 t_error("dlsym failed\n");
22 for (i = 0; i < 4; i++) {
23 if (!t[i].name)
24 t_error("name is not set for t[%d]\n", i);
25 if (t[i].addr & (t[i].align-1))
26 t_error("bad alignment: %s, size: %u, align: %u, addr: 0x%lx\n",
27 t[i].name, t[i].size, t[i].align, t[i].addr);
29 return t_status;