Commit | Line | Data |
---|---|---|
6e33951e L |
1 | #include <bfd_stdint.h> |
2 | ||
3 | extern void bar (void); | |
4 | extern void foo (void); | |
5 | extern void foo_alias (void); | |
37d7d56c | 6 | extern 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 | |
13 | int | |
14 | foo_p (void) | |
15 | { | |
16 | return (intptr_t) &foo == 0x12345678 ? 1 : 0; | |
17 | } | |
18 | ||
19 | int | |
20 | main (void) | |
21 | { | |
22 | foo (); | |
23 | foo_p (); | |
24 | bar (); | |
25 | check_ptr_eq (&foo, &foo_alias); | |
26 | return 0; | |
27 | } |