+2019-06-15 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR objc/90709
+ * obj-c++.dg/proto-lossage-7.mm: Use proxy headers.
+ * obj-c++.dg/strings/const-cfstring-2.mm: Likewise.
+ * obj-c++.dg/strings/const-cfstring-5.mm: Likewise
+ * obj-c++.dg/strings/const-str-12.mm: Likewise.
+ * obj-c++.dg/syntax-error-1.mm: Likewise.
+ * obj-c++.dg/torture/strings/const-cfstring-1.mm: Likewise.
+ * obj-c++.dg/torture/strings/const-str-10.mm: Likewise.
+ * obj-c++.dg/torture/strings/const-str-11.mm: Likewise.
+ * obj-c++.dg/torture/strings/const-str-9.mm: Likewise.
+ * obj-c++.dg/cxx-ivars-3.mm: Skip on later Darwin, where the 10.4 API
+ in no longer supported, also on m64 where there's no meaning to it.
+ * obj-c++.dg/isa-field-1.mm: Suppress unwanted warning, add comment why.
+ * obj-c++.dg/objc-gc-3.mm: Skip for Darwin > 16, the API use is an error
+ there.
+ * obj-c++.dg/qual-types-1.mm: Prune a spurious l64 warning.
+ * obj-c++.dg/stubify-1.mm: Tidy up after better compiler warnings.
+ * obj-c++.dg/stubify-2.mm: Likewise.
+ * obj-c++.dg/try-catch-1.mm: Likewise.
+ * obj-c++.dg/try-catch-3.mm: Likewise.
+
2019-06-15 Iain Sandoe <iain@sandoe.co.uk>
PR objc/90709
// { dg-do run { target *-*-darwin* } }
// { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } }
+// { dg-skip-if "Headers incompatible with 10.4 APIs" { *-*-darwin1[3-8]* } { "-fnext-runtime" } { "" } }
// { dg-additional-options "-fobjc-call-cxx-cdtors -mmacosx-version-min=10.4 -framework Foundation" }
// This test has no equivalent or meaning for m64/ABI V2
-// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
+// { dg-xfail-run-if "No Test Avail" { *-*-darwin* && lp64 } { "-fnext-runtime" } { "" } }
#include <objc/objc-runtime.h>
#include <stdlib.h>
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
//extern "C" { int printf(const char *,...); }
#define CHECK_IF(expr) if(!(expr)) abort()
/* 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 is works. */
+/* { dg-additional-options "-Wno-deprecated-declarations" } */
#include "../objc-obj-c++-shared/TestsuiteObject.h"
#include "../objc-obj-c++-shared/runtime.h"
/* 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 "cc1objplus: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
/* Check that typedefs of ObjC classes preserve
any @protocol qualifiers. */
/* { dg-do compile } */
+/* Suppress warnings that the GNUStep headers introduce. */
+/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */
#ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
#define OBJECT NSObject
#else
#include <objc/Object.h>
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-prune-output ".*ld: warning: direct access in.*" } */
+
#include "../objc-obj-c++-shared/TestsuiteObject.m"
#include <stdlib.h>
/* { dg-skip-if "NeXT only" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-options "-ftrack-macro-expansion=0 -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
/* { 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;
/* { dg-options "-mno-constant-cfstrings -fconstant-string-class=Foo" { target *-*-darwin* } } */
#ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
+#include "../../objc-obj-c++-shared/F-NSObject.h"
#define OBJECT NSObject
#else
#include <objc/Object.h>
int x = 41 ;
extern "C" {
- extern id objc_msgSend(id self, char * op, ...);
+ extern id objc_msgSend(id self, objc_selector* op, ...);
extern int bogonic (int, int, int);
}
- (Document *) close;
@end
@implementation Document
-- (Document *) class { }
-- (Document *) close { }
-- (Document *) window { }
+- (Document *) class { return (Document *)0; }
+- (Document *) close { return (Document *)0; }
+- (Document *) window { return (Document *)0; }
- (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
[[self window] close];
((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
- (Document *) close;
@end
@implementation Document
-- (Document *) class { }
-- (Document *) close { }
-- (Document *) window { }
+- (Document *) class { return (Document *)0; }
+- (Document *) close { return (Document *)0; }
+- (Document *) window { return (Document *)0; }
- (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
[[self window] close];
((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
/* Graceful handling of a syntax error. */
/* { dg-do compile } */
+/* Suppress warnings that the GNUStep headers introduce. */
+/* { dg-additional-options "-std=gnu++11 -Wno-expansion-to-defined -Wno-variadic-macros" { target *-*-darwin* } } */
#ifdef __NEXT_RUNTIME__
-#include <Foundation/NSObject.h>
+#include "../objc-obj-c++-shared/F-NSObject.h"
#define OBJECT NSObject
#else
#include <objc/Object.h>
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) {
checkNSRange([@"Hello World" rangeOfString:(id)CFSTR("World")]);
checkNSRange([(id)CFSTR("Hello World") rangeOfString:(id)CFSTR("World")]);
- checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", 0));
- checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", 0));
- checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), 0));
- checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), 0));
+ checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", (CFStringCompareFlags)0));
+ checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", (CFStringCompareFlags)0));
+ checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), (CFStringCompareFlags)0));
+ checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), (CFStringCompareFlags)0));
/* Check for string uniquing. */
if (s0a != s0b || s0a != s2 || s1 != (id)s2) {
/* { 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 NSString: NSObject
/* { 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 {
/* { 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 {
@finally {
printf("In @finally block (%d)... ", exc_control);
}
+ return -1;
}
@catch (TestsuiteObject* theException) {
return [theException name];
}
+ return (const char *)0;
}