diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-14 00:50:34 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-14 00:50:34 +0000 |
commit | 5c43f6507ecf553d86638bb5b318babcb6aaeec3 (patch) | |
tree | f528ed25ee144d3558289d8725d28f56df5995ca /gcc/testsuite/g++.old-deja | |
parent | 0837efa0d36f65b966116c0ffd2a2a351e0b83bf (diff) | |
download | ppe42-gcc-5c43f6507ecf553d86638bb5b318babcb6aaeec3.tar.gz ppe42-gcc-5c43f6507ecf553d86638bb5b318babcb6aaeec3.zip |
* defaults.h (TARGET_VTABLE_ENTRY_ALIGN): New.
(TARGET_VTABLE_DATA_ENTRY_DISTANCE): New.
* doc/tm.texi: Document them.
* config/ia64/ia64.h (TARGET_VTABLE_ENTRY_ALIGN): New.
(TARGET_VTABLE_DATA_ENTRY_DISTANCE): New.
(TARGET_VTABLE_USES_DESCRIPTORS): 4 word descriptors for 32-bit mode.
(ASM_OUTPUT_FDESC): Likewise.
* class.c (build_vtable): Use TARGET_VTABLE_ENTRY_ALIGN.
(build_vtbl_initializer): Honor TARGET_VTABLE_DATA_ENTRY_DISTANCE.
(build_vbase_offset_vtbl_entries): Likewise.
* rtti.c (build_headof): Likewise.
(get_tinfo_decl_dynamic): Likewise.
(create_pseudo_type_info): Likewise.
* g++.old-deja/g++.abi/vtable2.C (INC_VDATA): New. Define for
ia64 ilp32.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54603 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.abi/vtable2.C | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C index 9847a15a8b8..47afa15e807 100644 --- a/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C +++ b/gcc/testsuite/g++.old-deja/g++.abi/vtable2.C @@ -130,10 +130,17 @@ void _ZN2S42s1Ev (); // IA-64 uses function descriptors not function pointers in its vtables. #if defined __ia64__ #define CMP_VPTR(A, B) (*(void **)(A) == *(void **)(B)) +#ifdef _LP64 #define INC_VPTR(A) ((A) += 2) +#define INC_VDATA(A,N) ((A) += (N)) +#else +#define INC_VPTR(A) ((A) += 4) +#define INC_VDATA(A,N) ((A) += 2*(N)) +#endif #else #define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B)) #define INC_VPTR(A) ((A) += 1) +#define INC_VDATA(A,N) ((A) += (N)) #endif int main () @@ -145,18 +152,22 @@ int main () // Set vtbl to point at the beginning of S4's primary vtable. vptr = (ptrdiff_t **) &s4; vtbl = *vptr; - vtbl -= 5; + INC_VDATA (vtbl, -5); - if (*vtbl++ != ((char*) (S0*) &s4) - (char*) &s4) + if (*vtbl != ((char*) (S0*) &s4) - (char*) &s4) return 1; - if (*vtbl++ != ((char*) (S1*) &s4) - (char*) &s4) + INC_VDATA (vtbl, 1); + if (*vtbl != ((char*) (S1*) &s4) - (char*) &s4) return 2; - if (*vtbl++ != ((char*) (S2*) &s4) - (char*) &s4) + INC_VDATA (vtbl, 1); + if (*vtbl != ((char*) (S2*) &s4) - (char*) &s4) return 3; - if (*vtbl++ != 0) + INC_VDATA (vtbl, 1); + if (*vtbl != 0) return 4; + INC_VDATA (vtbl, 1); // Skip the RTTI entry. - vtbl++; + INC_VDATA (vtbl, 1); if (! CMP_VPTR (vtbl, &_ZN2S32s3Ev)) return 5; INC_VPTR (vtbl); @@ -164,21 +175,26 @@ int main () return 6; INC_VPTR (vtbl); // The S1 vbase offset. - if (*vtbl++ != 0) + if (*vtbl != 0) return 7; + INC_VDATA (vtbl, 1); // The S4::s1 vcall offset is negative; once you convert to S2, you // have to convert to S4 to find the final overrider. - if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4)) + if (*vtbl != ((char*) &s4 - (char*) (S2*) &s4)) return 8; - if (*vtbl++ != 0) + INC_VDATA (vtbl, 1); + if (*vtbl != 0) return 9; - if (*vtbl++ != 0) + INC_VDATA (vtbl, 1); + if (*vtbl != 0) return 10; + INC_VDATA (vtbl, 1); // Now we're at the S2 offset to top entry. - if (*vtbl++ != ((char*) &s4 - (char*) (S2*) &s4)) + if (*vtbl != ((char*) &s4 - (char*) (S2*) &s4)) return 11; + INC_VDATA (vtbl, 1); // Skip the RTTI entry. - vtbl++; + INC_VDATA (vtbl, 1); // Skip the remaining virtual functions -- they are thunks. INC_VPTR (vtbl); INC_VPTR (vtbl); |