2015-07-25 22:56:18 +08:00
|
|
|
#include <stdio.h>
|
2021-03-31 07:37:02 +08:00
|
|
|
#include <stdint.h>
|
2015-07-25 22:56:18 +08:00
|
|
|
|
|
|
|
extern void foo (void);
|
2017-02-16 19:49:10 +08:00
|
|
|
extern void check_ptr_eq (void (*) (void), void (*) (void));
|
2015-07-25 22:56:18 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
new_foo (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
__asm__(".symver new_foo, foo@@VERS_2.0");
|
2016-12-03 18:29:43 +08:00
|
|
|
#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
|
|
|
|
__asm__(".symver .new_foo, .foo@@VERS_2.0");
|
|
|
|
#endif
|
2015-07-25 22:56:18 +08:00
|
|
|
|
2015-07-30 02:20:04 +08:00
|
|
|
#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005
|
2015-07-25 22:56:18 +08:00
|
|
|
__attribute__ ((noinline, noclone))
|
2015-07-30 02:20:04 +08:00
|
|
|
#else
|
|
|
|
__attribute__ ((noinline))
|
|
|
|
#endif
|
2015-07-25 22:56:18 +08:00
|
|
|
int
|
|
|
|
bar (void)
|
|
|
|
{
|
|
|
|
return (intptr_t) &foo == 0x12345678 ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
bar ();
|
2015-07-28 01:04:31 +08:00
|
|
|
check_ptr_eq (&foo, &new_foo);
|
2015-07-25 22:56:18 +08:00
|
|
|
printf("PASS\n");
|
|
|
|
return 0;
|
|
|
|
}
|