adjust recent tests for -fnext-runtime:
authorIain Sandoe <iains@gcc.gnu.org>
Thu, 14 Oct 2010 10:40:07 +0000 (10:40 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Thu, 14 Oct 2010 10:40:07 +0000 (10:40 +0000)
gcc/testsuite:

* objc.dg/pr45878.m: Update to include NSConstantString interface
for -fnext-runtime.
* objc.dg/pr23214.m: Use the Object1.m implementation to build m64 on
-fnext-runtime, XFAIL the m64 -fnext-runtime run.
* objc.dg/objc-foreach-4.m: Provide an NSConstantString dummy class
reference for m64 -fnext-runtime.

From-SVN: r165461

gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/objc-foreach-4.m
gcc/testsuite/objc.dg/pr23214.m
gcc/testsuite/objc.dg/pr45878.m

index df9f88c..4f4d137 100644 (file)
@@ -1,3 +1,12 @@
+2010-10-14  Iain Sandoe  <iains@gcc.gnu.org>
+
+       * objc.dg/pr45878.m: Update to include NSConstantString interface
+       for -fnext-runtime.
+       * objc.dg/pr23214.m: Use the Object1.m implementation to build m64 on
+       -fnext-runtime, XFAIL the m64 -fnext-runtime run.
+       * objc.dg/objc-foreach-4.m: Provide an NSConstantString dummy class
+       reference for m64 -fnext-runtime.
+
 2010-10-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/vect-sizes-1.c: New.
index 1a6c101..69c8c73 100644 (file)
@@ -6,6 +6,12 @@
 #include <objc/objc-api.h>
 #include <Foundation/Foundation.h>
 
+#if defined (__NEXT_RUNTIME__) && defined (__LP64__)
+/* Fudge the class reference until we implement the compiler-side 
+   const strings.  */
+extern void *_NSConstantStringClassReference;
+#endif
+
 // gcc -o foo foo.m -framework Foundation
 
 int main (int argc, char const* argv[]) {
index 946dbeb..8443c94 100644 (file)
@@ -2,9 +2,11 @@
    Protocol instances.  */
 
 /* { dg-do run } */
+/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
 
-#include <objc/Object.h>
-#include <objc/Protocol.h>
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/Protocol1.h"
 
 @protocol A
 @end
index 0c6b908..39fd6c3 100644 (file)
@@ -11,12 +11,22 @@ typedef unsigned char  BOOL;
 - (BOOL)isEqual:anObject;
 @end
 
+#ifdef __NEXT_RUNTIME__
+@interface NSConstantString: Object
+{
+  char *c_string;
+  unsigned int len;
+}
+@end
+extern void *_NSConstantStringClassReference;
+#else
 @interface NXConstantString: Object
 {
   char *c_string;
   unsigned int len;
 }
 @end
+#endif
 
 void function (void)
 {