From 9efc84e45e6a0e840b10646574b24403f9c3ea57 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Sat, 28 Jan 2017 18:01:22 +0000 Subject: [PATCH] re PR testsuite/70583 (FAIL: g++.old-deja/g++.abi/vtable2.C -std=gnu++98 execution test) PR testsuite/70583 * g++.old-deja/g++.abi/vtable2.C: Adjust CMP_VPTR define on hppa. From-SVN: r245007 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.old-deja/g++.abi/vtable2.C | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b68985486e3..d003ae4e34e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2017-01-28 John David Anglin + PR testsuite/70583 + * g++.old-deja/g++.abi/vtable2.C: Adjust CMP_VPTR define on hppa. + * gnat.dg/debug7.adb: Skip on hppa*-*-hpux*. * gnat.dg/debug9.adb: Likewise. diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C index b64f0fc257a..30228756f12 100644 --- a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C +++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C @@ -142,10 +142,24 @@ extern "C" { #define INC_VDATA(A,N) ((A) += 2*(N)) #endif #else +// HPPA uses function pointers but they point to function descriptors. +#if defined __hppa__ +#ifdef __hpux__ +#ifdef _LP64 +#define CMP_VPTR(A, B) (*(unsigned long *)(*(A)+16) == *(unsigned long *)((unsigned long)(B)+16)) +#else +#define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B)) +#endif /* _LP64 */ +#else +extern "C" { unsigned int __canonicalize_funcptr_for_compare (void*); } +#define CMP_VPTR(A, B) (__canonicalize_funcptr_for_compare(*(void **)A) == __canonicalize_funcptr_for_compare((void *)B)) +#endif /* __hpux__ */ +#else #define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B)) +#endif /* __hppa__ */ #define INC_VPTR(A) ((A) += 1) #define INC_VDATA(A,N) ((A) += (N)) -#endif +#endif /* __ia64__ */ int main () { -- 2.30.2