[objective-c/c++, testsuite, 2/3] Workaround for PR90709.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 15 Jun 2019 14:00:24 +0000 (14:00 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sat, 15 Jun 2019 14:00:24 +0000 (14:00 +0000)
Use the CF-CFString.h, F-NS*.h proxy headers where needed in the objective-c
testsuite.  Make minor adjustments to tests as required, providing that those
do not alter the test intent.

2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>

PR objc/90709
* objc.dg/encode-7-next-64bit.m: Use proxy headers.
* objc.dg/image-info.m: Likewise.
* objc.dg/method-6.m: Likewise.
* objc.dg/no-extra-load.m: Likewise.
* objc.dg/objc-foreach-4.m: Likewise.
* objc.dg/objc-foreach-5.m: Likewise.
* objc.dg/proto-lossage-7.m: Likewise.
* objc.dg/strings/const-cfstring-2.m: Likewise.
* objc.dg/strings/const-cfstring-5.m: Likewise.
* objc.dg/strings/const-str-12b.m: Likewise.
* objc.dg/symtab-1.m: Likewise.
* objc.dg/torture/strings/const-cfstring-1.m: Likewise.
* objc.dg/torture/strings/const-str-10.m: Likewise.
* objc.dg/torture/strings/const-str-11.m: Likewise.
* objc.dg/torture/strings/const-str-9.m: Likewise.
* objc.dg/zero-link-1.m: Likewise.
* objc.dg/zero-link-2.m: Likewise.
* objc.dg/zero-link-3.m: Likewise.
* objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why.
* objc.dg/headers.m: XFAIL for Darwin14-19.
* objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error
there.

From-SVN: r272326

22 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/objc.dg/encode-7-next-64bit.m
gcc/testsuite/objc.dg/headers.m
gcc/testsuite/objc.dg/image-info.m
gcc/testsuite/objc.dg/isa-field-1.m
gcc/testsuite/objc.dg/method-6.m
gcc/testsuite/objc.dg/no-extra-load.m
gcc/testsuite/objc.dg/objc-foreach-4.m
gcc/testsuite/objc.dg/objc-foreach-5.m
gcc/testsuite/objc.dg/objc-gc-4.m
gcc/testsuite/objc.dg/proto-lossage-7.m
gcc/testsuite/objc.dg/strings/const-cfstring-2.m
gcc/testsuite/objc.dg/strings/const-cfstring-5.m
gcc/testsuite/objc.dg/strings/const-str-12b.m
gcc/testsuite/objc.dg/symtab-1.m
gcc/testsuite/objc.dg/torture/strings/const-cfstring-1.m
gcc/testsuite/objc.dg/torture/strings/const-str-10.m
gcc/testsuite/objc.dg/torture/strings/const-str-11.m
gcc/testsuite/objc.dg/torture/strings/const-str-9.m
gcc/testsuite/objc.dg/zero-link-1.m
gcc/testsuite/objc.dg/zero-link-2.m
gcc/testsuite/objc.dg/zero-link-3.m

index f8a1084c4aab8e0f7c8dacb242fa6749e9ae4f5e..9b2dcf0d7e5039f00b064ef24c642210d81e58a0 100644 (file)
@@ -1,3 +1,29 @@
+2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR objc/90709
+       * objc.dg/encode-7-next-64bit.m: Use proxy headers.
+       * objc.dg/image-info.m: Likewise.
+       * objc.dg/method-6.m: Likewise.
+       * objc.dg/no-extra-load.m: Likewise.
+       * objc.dg/objc-foreach-4.m: Likewise.
+       * objc.dg/objc-foreach-5.m: Likewise.
+       * objc.dg/proto-lossage-7.m: Likewise.
+       * objc.dg/strings/const-cfstring-2.m: Likewise.
+       * objc.dg/strings/const-cfstring-5.m: Likewise.
+       * objc.dg/strings/const-str-12b.m: Likewise.
+       * objc.dg/symtab-1.m: Likewise.
+       * objc.dg/torture/strings/const-cfstring-1.m: Likewise.
+       * objc.dg/torture/strings/const-str-10.m: Likewise.
+       * objc.dg/torture/strings/const-str-11.m: Likewise.
+       * objc.dg/torture/strings/const-str-9.m: Likewise.
+       * objc.dg/zero-link-1.m: Likewise.
+       * objc.dg/zero-link-2.m: Likewise.
+       * objc.dg/zero-link-3.m: Likewise.
+       * objc.dg/isa-field-1.m: Suppress unwanted warning, add comment why.
+       * objc.dg/headers.m: XFAIL for Darwin14-19.
+       * objc.dg/objc-gc-4.m: Skip for Darwin > 16, the API use is an error
+       there.
+
 2019-06-15  Iain Sandoe  <iain@sandoe.co.uk>
 
        PR objc/90709
index 4a418fc92b1af0a16f6b3c5e54473ce574794ece..5686cb4c537fda6996e623db8c1937946fb39374 100644 (file)
@@ -9,10 +9,11 @@
 #include <stdbool.h>
 #include <string.h>
 #include <stdlib.h>
-#include <Foundation/NSObject.h>
+#include <stdio.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
+#include "../objc-obj-c++-shared/CF-CFString.h"
 #include "../objc-obj-c++-shared/runtime.h"
 
-extern int printf(char *,...);
 void CHECK_IF(const char *s1, const char *s2)
 {
  if (strcmp(s1,s2) != 0) {
index 355c2cf3c60d7d9d741c52b8220f95c458c5174d..e628199f0cca86cd64997b1c5e56dfeb932f78da 100644 (file)
@@ -2,6 +2,7 @@
 // test in libstdc++-v3).  Author: Loren J. Rittle <ljrittle@acm.org>.
 // { dg-options "-Wall -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wshadow" }
 // { dg-do compile }
+/* { dg-xfail-if "PR90709" { *-*-darwin1[4-9]* } { "-fnext-runtime" } { "" } } */
 
 #ifdef __NEXT_RUNTIME__
 #include <Foundation/NSString.h>
index 09329130a7364fbbebeb938ea8519f1724ab143c..b2effe5dc861f94141dffa586cdb21e12e13e07c 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-skip-if "NeXT-only" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-freplace-objc-classes" } */
 
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 
 extern void abort(void);
 #define CHECK_IF(expr) if(!(expr)) abort();
index 4501d01a11e605d36771671817b0aa5aa7b035a6..a786ec3deb50588d1bed1e4b6d3e8323215837e5 100644 (file)
@@ -1,5 +1,7 @@
 /* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects.  */
 /* { dg-do compile } */
+/* The use of isa is deprecated, but we still want to test that it works. */
+/* { dg-additional-options "-Wno-deprecated-declarations" } */
 
 #include "../objc-obj-c++-shared/TestsuiteObject.h"
 #include "../objc-obj-c++-shared/runtime.h"
index 3ff73e0e9ca3b8ba144060c9a31b1788030b6485..7d3b11c5c75ae9aa3073cf2b264fd6c4c0783589 100644 (file)
@@ -5,12 +5,12 @@
 /* { dg-options "-Wstrict-selector-match" } */
 
 #ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
-#define OBJECT NSObject
+# include "../objc-obj-c++-shared/F-NSObject.h"
+# define OBJECT NSObject
 #else
-#include <objc/Object.h>
-#include <objc/Protocol.h>
-#define OBJECT Object
+# include <objc/Object.h>
+# include <objc/Protocol.h>
+# define OBJECT Object
 #endif
 
 @interface Base
index f5e1d74563d52f306b004a26bd4716f67255d0b5..35bd1daf661aa35130f17c6b6e48978fb5d3aa1b 100644 (file)
@@ -1,7 +1,7 @@
 /* { dg-do compile { target *-*-darwin* } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 main() { [NSObject new]; }
 
 /* { dg-final { scan-assembler-not "L_objc_msgSend\\\$non_lazy_ptr" } } */
index 4d902f5588205b8c0faf0e9dcfa854efd36541a1..c8dc074b267c605e8dd96e8b6554218b0ac9b852 100644 (file)
@@ -5,9 +5,9 @@
 /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */
 
-#include <Foundation/NSString.h>
-#include <Foundation/NSAutoreleasePool.h>
-#include <Foundation/NSArray.h>
+#include "../objc-obj-c++-shared/F-NSString.h"
+#include "../objc-obj-c++-shared/F-NSAutoreleasePool.h"
+#include "../objc-obj-c++-shared/F-NSArray.h"
 
 // gcc -o foo foo.m -framework Foundation
 
index 7113a7ac26266a3629a67962e4531e0eb44b2a63..e02bd7aa06dd8078e5a2ae73e6939b2741f2e582 100644 (file)
@@ -4,8 +4,9 @@
 /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */
 
-#include <Foundation/NSArray.h>
-#include <Foundation/NSAutoreleasePool.h>
+#include "../objc-obj-c++-shared/F-NSArray.h"
+#include "../objc-obj-c++-shared/F-NSAutoreleasePool.h"
+#include "../objc-obj-c++-shared/F-NSValue.h"
 
 NSArray * createTestVictim(unsigned capacity) {
     NSMutableArray * arr = [[NSMutableArray alloc] initWithCapacity:capacity];
index 747da4d5199cee7b47852269ba4f87cd94ad9367..96c32788dfe01bd1369f588e6504fec3c80ff03d 100644 (file)
@@ -3,6 +3,7 @@
 /* Contributed by Ziemowit Laski <zlaski@apple.com>  */
 
 /* { dg-do compile } */
+/* { dg-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-8]* } { "-fnext-runtime" } { "" } } */
 /* { dg-options "-fobjc-gc" } */
 /* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
 
index b32cfd8a0dd62403c06b3b3da167ca701bc5637a..118a130fd9e9e7addb9ad7b740800917687644dc 100644 (file)
@@ -3,7 +3,7 @@
 /* { dg-do compile } */
 
 #ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 #define OBJECT NSObject
 #else
 #include <objc/Object.h>
index 14ae68c6c501ca5cc451bbae286fd27ed5eeeb6b..effe7f57bdcc069d61de4995e4c264537e29b7e9 100644 (file)
@@ -8,8 +8,8 @@
 /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-mconstant-cfstrings -Wnonportable-cfstrings" } */
 
-#import <Foundation/NSString.h>
-#import <CoreFoundation/CFString.h>
+#include "../../objc-obj-c++-shared/F-NSString.h"
+#include "../../objc-obj-c++-shared/CF-CFString.h"
 
 #ifndef __CONSTANT_CFSTRINGS__
 #error The -fconstant-cfstrings option is not functioning properly
index 98bb7c5bddc1b57b5d696d580169bb1c32246694..762afb6b1ba5c256685a9ea9cbae3a3aa2a314f8 100644 (file)
@@ -6,7 +6,7 @@
 /* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-mconstant-cfstrings" } */
 
-#include <Foundation/NSObject.h>
+#include "../../objc-obj-c++-shared/F-NSObject.h"
 
 @interface Foo: NSObject {
   char *cString;
index d0dfb668ea93b666077eedf3ffc9cfcdd3858100..e04f0f66660570320b97d470c107daabbe7677c3 100644 (file)
@@ -6,11 +6,11 @@
 /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */
 
 #ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
-#define OBJECT NSObject
+# include "../../objc-obj-c++-shared/F-NSObject.h"
+# define OBJECT NSObject
 #else
-#include <objc/Object.h>
-#define OBJECT Object
+# include <objc/Object.h>
+# define OBJECT Object
 #endif
 #include "../../objc-obj-c++-shared/objc-test-suite-types.h"
 
index 04d747dbce1650e0318cfbb634cedfd400a3887c..e6e0b613923d8bc804ffc5dd4b59df5e27b384d8 100644 (file)
@@ -4,7 +4,7 @@
 /* { dg-do compile { target { *-*-darwin* } } } */
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 
 @interface Base: NSObject 
 - (void)setValues;
index 7e98915641902a6e526f1a636f5ceca6900e36c3..a9c0ab666f1f38d7ccd319209cce81fa74d6a459 100644 (file)
@@ -13,8 +13,8 @@
    Well, we don't implement writable ones at this juncture.  */
 /* { dg-options "-mconstant-cfstrings -framework Cocoa -Wl,-w" { target *-*-darwin[123]* } } */
 
-#import <Foundation/NSString.h>
-#import <CoreFoundation/CFString.h>
+#include "../../../objc-obj-c++-shared/F-NSString.h"
+#include "../../../objc-obj-c++-shared/CF-CFString.h"
 #include <stdlib.h>
 
 void printOut(NSString *str) {
index 120bcd94c7bfff386b97da82ae2232e098d1012b..6565dc20007dcf9b294affc32b1ba9088ab1aa95 100644 (file)
@@ -6,7 +6,8 @@
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
 
-#include <Foundation/NSObject.h>
+#include "../../../objc-obj-c++-shared/F-NSObject.h"
+#include <stdlib.h>
 #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE.  */
 
 @interface NSString: NSObject
index 4c3f9eac893ebec626812108dba4daa08fd61484..2bdb1531e1d769d76c4f74f4193faaa452c4a4eb 100644 (file)
@@ -7,7 +7,7 @@
 /* { dg-options "-fconstant-string-class=XStr" } */
 /* { dg-options "-mno-constant-cfstrings -fconstant-string-class=XStr" { target *-*-darwin* } } */
 
-#include <Foundation/NSObject.h>
+#include "../../../objc-obj-c++-shared/F-NSObject.h"
 #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE.  */
 
 @interface XString: NSObject {
index d65aa01c044db8b5c8a128e093c37fb8a5ee897e..966ea5e498d1567962e14b4deb97815717c58644 100644 (file)
@@ -5,7 +5,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-mno-constant-cfstrings" { target *-*-darwin* } } */
 
-#include <Foundation/NSObject.h>
+#include "../../../objc-obj-c++-shared/F-NSObject.h"
 #include "../../../objc-obj-c++-shared/runtime.h" /* For NEXT_OBJC_USE_NEW_INTERFACE.  */
 
 @interface NSConstantString: NSObject {
index 812267bc376df32fe8b5fb24206494177f3d3ae0..e1148deb4a75c3b81b775e7b923b7994227031d8 100644 (file)
@@ -5,7 +5,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-fzero-link" } */
 
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 
 extern void abort(void);
 #define CHECK_IF(expr) if(!(expr)) abort();
index 3bfe84d021d365de6b77c1e9098c8ac98ef10874..19100919b3c73ee1210d6311bbb84955e00ec9f9 100644 (file)
@@ -5,7 +5,7 @@
 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
 /* { dg-options "-fno-zero-link" } */
 
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
 
 extern void abort(void);
 #define CHECK_IF(expr) if(!(expr)) abort();
index 18f21db4e653d053123e374b361ccf7f7885c9cd..0c77c095d4d3cb109f41a779f9457ef6c2fe9f93 100644 (file)
@@ -7,12 +7,12 @@
 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
 
 #ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
-#define OBJECT NSObject
+# include "../objc-obj-c++-shared/F-NSObject.h"
+# define OBJECT NSObject
 #else
-#include <objc/Object.h>
-#include <objc/Protocol.h>
-#define OBJECT Object
+# include <objc/Object.h>
+# include <objc/Protocol.h>
+# define OBJECT Object
 #endif
 
 extern void abort(void);