Patchwork [Objc/NeXT/Testuite,committed] *foreach* adjustments for Darwin

login
register
mail settings
Submitter IainS
Date Jan. 9, 2011, 4:35 p.m.
Message ID <19C55850-6566-47CA-9082-BB6DB101645E@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/78037/
State New
Headers show

Comments

IainS - Jan. 9, 2011, 4:35 p.m.
we've picked up a fair number of test-suite fails (especially on  
Darwin8) because of absent functionality and minor nits with headers.

Part 1.
Darwin 8 does not have fast enumeration support in its NeXT lib - so  
skipping those tests.
We also need to ensure that 'self' is returned from init methods where  
required (it's a miracle that it works some of the time as is).

checked on x86_64-linux, i686-darwin8, i686-darwin9, x86_64-darwin10.
applied as 168616
cheers
Iain

gcc/testsuite:

	* objc.dg/foreach-1.m: Skip for Darwin < 9.
	* objc.dg/objc-foreach-4.m: Likewise.
	* objc.dg/objc-foreach-5.m: Skip for Darwin < 9, adjust headers.
	* objc.dg/foreach-2.m: Skip for Darwin < 9, return self from init.
	* objc.dg/foreach-4.m: Likewise.
	* objc.dg/foreach-5.m: Likewise.
	* objc.dg/foreach-3.m: Return self from init.

Patch

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 168614)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,13 @@ 
+2011-01-09  Iain Sandoe  <iains@gcc.gnu.org>
+
+	* objc.dg/foreach-1.m: Skip for Darwin < 9.
+	* objc.dg/objc-foreach-4.m: Likewise.
+	* objc.dg/objc-foreach-5.m: Skip for Darwin < 9, adjust headers.
+	* objc.dg/foreach-2.m: Skip for Darwin < 9, return self from init.
+	* objc.dg/foreach-4.m: Likewise.
+	* objc.dg/foreach-5.m: Likewise.
+	* objc.dg/foreach-3.m: Return self from init.
+
 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR fortran/38536
Index: gcc/testsuite/objc.dg/foreach-1.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-1.m	(revision 168614)
+++ gcc/testsuite/objc.dg/foreach-1.m	(working copy)
@@ -2,6 +2,7 @@ 
    do nothing.
 */
 /* { dg-do run } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 /* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
 /* { dg-options "-Wall" } */
Index: gcc/testsuite/objc.dg/foreach-2.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-2.m	(revision 168614)
+++ gcc/testsuite/objc.dg/foreach-2.m	(working copy)
@@ -2,6 +2,7 @@ 
    the basic syntax 'for (object in array) statements'
 */
 /* { dg-do run } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
 /* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
@@ -49,6 +50,7 @@  struct __objcFastEnumerationState
   length = l;
   objects = o;
   mutated = 0;
+  return self;
 }
 - (void) mutate
 {
Index: gcc/testsuite/objc.dg/foreach-3.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-3.m	(revision 168614)
+++ gcc/testsuite/objc.dg/foreach-3.m	(working copy)
@@ -50,6 +50,7 @@  struct __objcFastEnumerationState
   length = l;
   objects = o;
   mutated = 0;
+  return self;
 }
 - (void) mutate
 {
Index: gcc/testsuite/objc.dg/foreach-4.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-4.m	(revision 168614)
+++ gcc/testsuite/objc.dg/foreach-4.m	(working copy)
@@ -2,6 +2,7 @@ 
    the declaration syntax 'for (id object in array) statements'
 */
 /* { dg-do run } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
 /* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
@@ -49,6 +50,7 @@  struct __objcFastEnumerationState
   length = l;
   objects = o;
   mutated = 0;
+  return self;
 }
 - (void) mutate
 {
Index: gcc/testsuite/objc.dg/foreach-5.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-5.m	(revision 168614)
+++ gcc/testsuite/objc.dg/foreach-5.m	(working copy)
@@ -2,6 +2,7 @@ 
    define your own NSFastEnumeration struct, the compiler picks it up.
 */
 /* { dg-do run } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
 /* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
@@ -47,6 +48,7 @@  typedef struct
   length = l;
   objects = o;
   mutated = 0;
+  return self;
 }
 - (void) mutate
 {
Index: gcc/testsuite/objc.dg/objc-foreach-4.m
===================================================================
--- gcc/testsuite/objc.dg/objc-foreach-4.m	(revision 168614)
+++ gcc/testsuite/objc.dg/objc-foreach-4.m	(working copy)
@@ -2,6 +2,7 @@ 
 /* FIXME: Run this test with the GNU runtime as well.  */
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 
 #include <objc/objc-api.h>
 #include <Foundation/Foundation.h>
Index: gcc/testsuite/objc.dg/objc-foreach-5.m
===================================================================
--- gcc/testsuite/objc.dg/objc-foreach-5.m	(revision 168614)
+++ gcc/testsuite/objc.dg/objc-foreach-5.m	(working copy)
@@ -1,8 +1,8 @@ 
 /* FIXME: Run this test with the GNU runtime as well.  */
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 
-#include <objc/objc-api.h>
 #import <Foundation/Foundation.h>
 
 NSArray * createTestVictim(unsigned capacity) {