fix math test gen script
[libc-test] / src / thread / tls_align_dso.c
1 #include <stddef.h>
2
3 __thread char      c1 = 1;
4 __thread char      xchar = 2;
5 __thread char      c2 = 3;
6 __thread short     xshort = 4;
7 __thread char      c3 = 5;
8 __thread int       xint = 6;
9 __thread char      c4 = 7;
10 __thread long long xllong = 8;
11
12 struct {
13         char *name;
14         size_t size;
15         size_t align;
16         size_t addr;
17 } t[4];
18
19 #define entry(i,x) \
20         t[i].name = #x; \
21         t[i].size = sizeof x; \
22         t[i].align = __alignof__(x); \
23         t[i].addr = (size_t)&x;
24
25 __attribute__((constructor)) static void init(void)
26 {
27         entry(0, xchar)
28         entry(1, xshort)
29         entry(2, xint)
30         entry(3, xllong)
31 }
32