functional: add mntent test
[libc-test.git] / src / functional / tls_align_dlopen.c
blob3f7ae34b547061d55cd89560a09a6c3de0ca095c
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");
21 else for (i = 0; i < 4; i++) {
22 if (!t[i].name)
23 t_error("name is not set for t[%d]\n", i);
24 if (t[i].addr & (t[i].align-1))
25 t_error("bad alignment: %s, size: %u, align: %u, addr: 0x%lx\n",
26 t[i].name, t[i].size, t[i].align, t[i].addr);
28 return t_status;