Automatic date update in version.in
[binutils-gdb.git] / ld / testsuite / ld-elf / p_align-1.c
blob6579cd74e524a87c4905392f2069042643478fbb
1 #include <stdio.h>
2 #include <stdint.h>
3 #include <stdlib.h>
5 #ifndef ALIGN
6 # define ALIGN 0x800000
7 #endif
9 int
10 __attribute__ ((weak))
11 is_aligned (void *p, int align)
13 return (((uintptr_t) p) & (align - 1)) == 0;
16 int foo __attribute__ ((aligned (ALIGN))) = 1;
18 int
19 main (void)
21 if (!is_aligned (&foo, ALIGN))
22 abort ();
23 printf ("PASS\n");
24 return 0;