]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/testsuite/ld-elf/pr18720a.c
ld testsuite function pointer comparisons vs. hppa
[thirdparty/binutils-gdb.git] / ld / testsuite / ld-elf / pr18720a.c
CommitLineData
6e33951e
L
1#include <bfd_stdint.h>
2
3extern void bar (void);
4extern void foo (void);
5extern void foo_alias (void);
ce697216 6extern void check_ptr_eq (void (*) (void), void (*) (void));
6e33951e
L
7
8#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005
9__attribute__ ((noinline, noclone))
10#else
11__attribute__ ((noinline))
12#endif
13int
14foo_p (void)
15{
16 return (intptr_t) &foo == 0x12345678 ? 1 : 0;
17}
18
19int
20main (void)
21{
22 foo ();
23 foo_p ();
24 bar ();
25 check_ptr_eq (&foo, &foo_alias);
26 return 0;
27}