Patchwork [objc/testsuite,committed] adjust foreach test-cases for NeXT runtime.

login
register
mail settings
Submitter IainS
Date Oct. 7, 2010, 2:43 p.m.
Message ID <AAA65BB8-EA6E-40A9-A40E-36A2A640B962@sandoe-acoustics.co.uk>
Download mbox | patch
Permalink /patch/67062/
State New
Headers show

Comments

IainS - Oct. 7, 2010, 2:43 p.m.
Hi
Adjust Nicola's new foreach tests for -fnext-runtime compatibility.
Applied as r165117.
Iain


gcc/testsuite:

	* objc.dg/foreach-1.m: Adjust for -fnext-runtime compatibility.
	* objc.dg/foreach-2.m: Likewise.
	* objc.dg/foreach-3.m: Likewise.
	* objc.dg/foreach-4.m: Likewise.
	* objc.dg/foreach-5.m: Likewise.
	* objc.dg/foreach-6.m: Likewise.
	* objc.dg/foreach-7.m: Likewise.
	* objc.dg/objc-foreach-4.m: Likewise.
	* objc.dg/objc-foreach-5.m: Likewise.

Patch

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 165116)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,15 @@ 
+2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
+
+	* objc.dg/foreach-1.m: Adjust for -fnext-runtime compatibility.
+	* objc.dg/foreach-2.m: Likewise.
+	* objc.dg/foreach-3.m: Likewise.
+	* objc.dg/foreach-4.m: Likewise.
+	* objc.dg/foreach-5.m: Likewise.
+	* objc.dg/foreach-6.m: Likewise.
+	* objc.dg/foreach-7.m: Likewise.
+	* objc.dg/objc-foreach-4.m: Likewise.
+	* objc.dg/objc-foreach-5.m: Likewise.
+
 2010-10-07  Richard Guenther  <rguenther@suse.de>
 
 	PR middle-end/45869
@@ -2,3 +14,3 @@ 
 	* gcc.dg/torture/pr45869.c: New testcase.
-
+	
 2010-10-07  Iain Sandoe  <iains@gcc.gnu.org>
Index: gcc/testsuite/objc.dg/foreach-1.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-1.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-1.m	(working copy)
@@ -1,12 +1,12 @@ 
 /* Test basic Objective-C foreach syntax.  This tests iterations that
    do nothing.
 */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { 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/objc.h>
-#include <objc/Object.h>
+#import "../objc-obj-c++-shared/Object1.h"
+
 extern void abort (void);
 /*
 struct __objcFastEnumerationState
Index: gcc/testsuite/objc.dg/foreach-2.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-2.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-2.m	(working copy)
@@ -1,15 +1,19 @@ 
 /* Test basic Objective-C foreach syntax.  This tests iterations, with
    the basic syntax 'for (object in array) statements'
 */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { 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/objc.h>
-#include <objc/Object.h>
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+#ifndef __NEXT_RUNTIME__
 #include <objc/NXConstStr.h>
+#endif
+
+extern int printf (const char *, ...);
 #include <stdlib.h>
-extern void abort (void);
+
 /*
 struct __objcFastEnumerationState
 {
Index: gcc/testsuite/objc.dg/foreach-3.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-3.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-3.m	(working copy)
@@ -1,18 +1,21 @@ 
 /* Test basic Objective-C foreach syntax.  This tests the mutation.
 */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+/* { dg-do compile } */
+
 /* FIXME: This test should be run, and it succeeds if the program
    aborts at the right time (when the mutation happens).  It currently
    works, but how do we tell the testsuite to test for it ?
 */
-/* { dg-do compile } */
 
-#include <objc/objc.h>
-#include <objc/Object.h>
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+#ifndef __NEXT_RUNTIME__
 #include <objc/NXConstStr.h>
+#endif
+
+extern int printf (const char *, ...);
 #include <stdlib.h>
-extern void abort (void);
+
 /*
 struct __objcFastEnumerationState
 {
Index: gcc/testsuite/objc.dg/foreach-4.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-4.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-4.m	(working copy)
@@ -1,15 +1,19 @@ 
 /* Test basic Objective-C foreach syntax.  This tests iterations, with
    the declaration syntax 'for (id object in array) statements'
 */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { 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/objc.h>
-#include <objc/Object.h>
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+#ifndef __NEXT_RUNTIME__
 #include <objc/NXConstStr.h>
+#endif
+
+extern int printf (const char *, ...);
 #include <stdlib.h>
-extern void abort (void);
+
 /*
 struct __objcFastEnumerationState
 {
Index: gcc/testsuite/objc.dg/foreach-5.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-5.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-5.m	(working copy)
@@ -1,15 +1,18 @@ 
 /* Test basic Objective-C foreach syntax.  This tests that if you
    define your own NSFastEnumeration struct, the compiler picks it up.
 */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { 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/objc.h>
-#include <objc/Object.h>
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+#ifndef __NEXT_RUNTIME__
 #include <objc/NXConstStr.h>
+#endif
+
+extern int printf (const char *, ...);
 #include <stdlib.h>
-extern void abort (void);
 
 typedef struct
 {
Index: gcc/testsuite/objc.dg/foreach-6.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-6.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-6.m	(working copy)
@@ -1,11 +1,9 @@ 
 /* Test basic Objective-C foreach syntax.  This tests warnings and errors.  */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { dg-do compile } */
 
-#include <objc/objc.h>
-#include <objc/Object.h>
-extern void abort (void);
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+
 /*
 struct __objcFastEnumerationState
 {
Index: gcc/testsuite/objc.dg/foreach-7.m
===================================================================
--- gcc/testsuite/objc.dg/foreach-7.m	(revision 165116)
+++ gcc/testsuite/objc.dg/foreach-7.m	(working copy)
@@ -1,11 +1,9 @@ 
 /* Test basic Objective-C foreach syntax.  This tests warnings and errors.  */
-/* FIXME: Run this test with the NeXT runtime as well.  */
-/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
 /* { dg-do compile } */
 
-#include <objc/objc.h>
-#include <objc/Object.h>
-extern void abort (void);
+#import "../objc-obj-c++-shared/Object1.h"
+#import "../objc-obj-c++-shared/next-mapping.h"
+
 /*
 struct __objcFastEnumerationState
 {
Index: gcc/testsuite/objc.dg/objc-foreach-4.m
===================================================================
--- gcc/testsuite/objc.dg/objc-foreach-4.m	(revision 165116)
+++ gcc/testsuite/objc.dg/objc-foreach-4.m	(working copy)
@@ -1,7 +1,9 @@ 
 /* Test for valid objc objects used in a for-each statement. */
 /* FIXME: Run this test with the GNU runtime as well.  */
+/* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
-/* { dg-do compile { target *-*-darwin* } } */
+
+#include <objc/objc-api.h>
 #include <Foundation/Foundation.h>
 
 // gcc -o foo foo.m -framework Foundation
Index: gcc/testsuite/objc.dg/objc-foreach-5.m
===================================================================
--- gcc/testsuite/objc.dg/objc-foreach-5.m	(revision 165116)
+++ gcc/testsuite/objc.dg/objc-foreach-5.m	(working copy)
@@ -1,6 +1,8 @@ 
 /* FIXME: Run this test with the GNU runtime as well.  */
+/* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
-/* { dg-do compile { target *-*-darwin* } } */
+
+#include <objc/objc-api.h>
 #import <Foundation/Foundation.h>
 
 NSArray * createTestVictim(unsigned capacity) {