Commit | Line | Data |
---|---|---|
1659f720 L |
1 | #include <stdio.h> |
2 | #include <bfd_stdint.h> | |
3 | ||
4 | extern void foo (void); | |
c45bd4fd | 5 | extern void check_ptr_eq (void *, void *); |
1659f720 L |
6 | |
7 | void | |
8 | new_foo (void) | |
9 | { | |
10 | } | |
11 | ||
12 | __asm__(".symver new_foo, foo@@VERS_2.0"); | |
4e95fbcd AM |
13 | #if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX |
14 | __asm__(".symver .new_foo, .foo@@VERS_2.0"); | |
15 | #endif | |
1659f720 | 16 | |
60b57502 | 17 | #if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005 |
1659f720 | 18 | __attribute__ ((noinline, noclone)) |
60b57502 L |
19 | #else |
20 | __attribute__ ((noinline)) | |
21 | #endif | |
1659f720 L |
22 | int |
23 | bar (void) | |
24 | { | |
25 | return (intptr_t) &foo == 0x12345678 ? 1 : 0; | |
26 | } | |
27 | ||
28 | int | |
29 | main(void) | |
30 | { | |
31 | bar (); | |
c45bd4fd | 32 | check_ptr_eq (&foo, &new_foo); |
1659f720 L |
33 | printf("PASS\n"); |
34 | return 0; | |
35 | } |