From patchwork Fri Jul 2 10:05:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [ObjC/C++, testsuite, committed] restore cxx-ivars-3.mm m32 functionality. Date: Fri, 02 Jul 2010 00:05:33 -0000 From: IainS X-Patchwork-Id: 57646 Message-Id: <9153E93E-072E-4493-A3CB-1CB1CE06ECF6@sandoe-acoustics.co.uk> To: GCC Patches Cc: mrs@gcc.gnu.org On closer reading of the NeXT V2 runtime ABI spec... ... it is clear that there is no m64 equivalent for this test and that the V2 ABI accessor provided does not give the same result. Mike: I would prefer, in the end, to make this ilp32 - it's just a waste of CPU time running it for m64 - but that would incur a removed "PASS" (the m64 compile currently succeeds), which I'm aware you don't like to do. However, if you're willing to approve such a change, I'll make an additional patch later. This patch retains the status quo (viz-a-viz m64) and restores m32. Committed as a partial reversion of r157731 and also covered by Mike's pre-approval of OBJC test-suite changes. tested on *-*darwin* and x86_64-unknow-linux-gnu r161692 (trunk) r161693 (4.5) Iain testsuite/ChangeLog: * obj-c++.dg/cxx-ivars-3.mm: Make the test require OSX <= 10.4. Use the ABI-0 accessors and fail it for m64. #include #define CHECK_IF(expr) if(!(expr)) abort() @@ -39,18 +38,17 @@ struct cxx_struct { int main (void) { +#ifndef __LP64__ Class cls; - cls = objc_get_class("Foo"); -#if NEXT_OBJC_USE_NEW_INTERFACE - CHECK_IF(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS); - cls = objc_getClass("Bar"); - CHECK_IF(!(class_isMetaClass(cls) & CLS_HAS_CXX_STRUCTORS)); -#else + cls = objc_getClass("Foo"); CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS); cls = objc_getClass("Bar"); CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS)); + +#else + /* No test needed or available. */ + abort (); #endif return 0; } -#include "../objc-obj-c++-shared/Object1-implementation.h" Index: gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm =================================================================== --- gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (revision 161691) +++ gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm (working copy) @@ -1,13 +1,12 @@ // Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata. // { dg-do run { target *-*-darwin* } } -// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } -// { dg-options "-fobjc-call-cxx-cdtors" } -// { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } +// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } +// { dg-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4" } +// This test has no equivalent or meaning for m64/ABI V2 +// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "- fnext-runtime" } { "" } } -#include "../objc-obj-c++-shared/Object1.h" -#include "../objc-obj-c++-shared/next-mapping.h" - +#include