Patchwork [ObjC/C++,testsuite,committed] restore cxx-ivars-3.mm m32 functionality.

login
register
mail settings
Submitter IainS
Date July 2, 2010, 10:05 a.m.
Message ID <9153E93E-072E-4493-A3CB-1CB1CE06ECF6@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/57646/
State New
Headers show

Comments

IainS - July 2, 2010, 10:05 a.m.
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 <stdlib.h>
  #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"
Mike Stump - July 3, 2010, 5:55 p.m.
On Jul 2, 2010, at 3:05 AM, IainS wrote:
> 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

Yes, please, add:

/* { dg-require-effective-target ilp32 } */

> 	* obj-c++.dg/cxx-ivars-3.mm: Make the test require OSX <= 10.4.
> 	Use the ABI-0 accessors and fail it for m64.

Patch

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 <objc/objc-runtime.h>