repo.or.cz
/
binutils-gdb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Automatic date update in version.in
[binutils-gdb.git]
/
ld
/
testsuite
/
ld-elf
/
p_align-1.c
blob
6579cd74e524a87c4905392f2069042643478fbb
1
#include <stdio.h>
2
#include <stdint.h>
3
#include <stdlib.h>
4
5
#ifndef ALIGN
6
# define ALIGN 0x800000
7
#endif
8
9
int
10
__attribute__
((
weak
))
11
is_aligned
(
void
*
p
,
int
align
)
12
{
13
return
(((
uintptr_t
)
p
) & (
align
-
1
)) ==
0
;
14
}
15
16
int
foo
__attribute__
((
aligned
(
ALIGN
))) =
1
;
17
18
int
19
main
(
void
)
20
{
21
if
(!
is_aligned
(&
foo
,
ALIGN
))
22
abort
();
23
printf
(
"PASS
\n
"
);
24
return
0
;
25
}