blob: 824c06d1f9abae8e827eba47a7e9af47cb9b8cd6 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdint.h>
2#include <stdio.h>
3
4#define AL 4096
5struct foo
6{
7 int i;
8} __attribute ((aligned (AL)));
9
10static __thread struct foo f;
11static struct foo g;
12
13
14#ifndef FCT
15# define FCT in_dso1
16#endif
17
18
19int
20FCT (void)
21{
22 puts (__func__);
23
24 int result = 0;
25
26 int fail = (((uintptr_t) &f) & (AL - 1)) != 0;
27 printf ("&f = %p %s\n", &f, fail ? "FAIL" : "OK");
28 result |= fail;
29
30 fail = (((uintptr_t) &g) & (AL - 1)) != 0;
31 printf ("&g = %p %s\n", &g, fail ? "FAIL" : "OK");
32 result |= fail;
33
34 return result;
35}