/* Test for graceful handling of anonymous ivars. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
unsigned char : 1;
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test deprecate attribute with an @interface declaration. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that you get a warning when an unknown class attribute is ignored. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include <stdlib.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, May 2011. */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include <stdlib.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include <stdlib.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */
/* { dg-do compile } */
/* { dg-options "-Wall" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include <stdlib.h>
/* Test handling of the NSObject attribute. */
/* { dg-additional-options "-fsyntax-only " } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct AnObj * __attribute__ ((NSObject)) AnObjRef;
typedef struct AnObj * __attribute__ ((__NSObject__)) AnotherObjRef;
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, February 2011. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that the 'objc_exception' attribute is accepted for
@interfaces, but not for anything else. */
/* Test __attribute__((unused)) for an Objective-C method parameter. */
/* { dg-do compile } */
/* { dg-options "-Wunused-parameter" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Test that we get warnings for unrecognized attributes. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test deprecate attribute with a forward declarations of
@protocol. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test deprecate attribute with normal @protocol declarations. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that you get a warning when an unknown protocol attribute is ignored. */
/* { dg-options "-fsigned-char" } */
/* { dg-do run { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface foo
- (void) test;
/* Redeclarations of class names. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef int foo; /* { dg-line foo_def } */
typedef int bar; /* { dg-line bar_def } */
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface bar
@end /* { dg-error "redeclared as different kind of symbol" } */
/* { dg-error "previous declaration of" "" { target *-*-* } bar_def } */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test tests the basic of class extensions. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test tests class extensions and protocols. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test tests warnings on class extensions. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test tests you can not declare a class extension after the class @implementation. */
/* Check Class <protocol> types */
/* Author: David Ayers <d.ayers@inode.at> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include "../objc-obj-c++-shared/runtime.h"
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* We used to ICE because we removed the cast to List_linked*
in -[ListIndex_linked next]. */
/* Test demangling an Objective-C method. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <string.h>
#include <stdlib.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that a duplicated @implementation for the same class does not
crash the compiler. */
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
struct Cxx {
const struct Cxx *next;
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
struct Cxx {
const struct Cxx *next;
/* Test use of @optional/@required keywords in @protocol class. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@protocol MyProto1
@optional
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test checks the syntax @catch (...) which catches any
exceptions. At the moment, @catch (...) is identical to @catch (id
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that the compiler is checking the argument of @catch(), and
produce errors when invalid types are used. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test warnings when parsing syntax errors in @catch(). */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that you can use an unnamed argument with @catch. This test is the same
as exceptions-3.m, but with no name for @catch arguments. */
/* Test warnings when using -fobjc-std=objc1. */
/* { dg-do compile } */
/* { dg-options "-fobjc-std=objc1" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@end
__attribute__ ((deprecated))
-@interface MyRootClass2
-{ /* { dg-error "class attributes are not available in Objective.C 1.0" } */
+@interface MyRootClass2 /* { dg-error "class attributes are not available in Objective.C 1.0" } */
+{
Class isa;
}
@end
/* { 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/nsconstantstring-class-impl.m" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include "../objc-obj-c++-shared/TestsuiteObject.m"
#ifndef __NEXT_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/nsconstantstring-class-impl.m" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#import "../objc-obj-c++-shared/TestsuiteObject.m"
#ifndef __NEXT_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/nsconstantstring-class-impl.m" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#import "../objc-obj-c++-shared/TestsuiteObject.m"
#ifndef __NEXT_RUNTIME__
/* { dg-do compile } */
/* { dg-options "-fsyntax-only" } */
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface foo
-(void) my_method:(int) i with:(int) j;
@end
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* { dg-additional-options "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */
/* To get the modern GNU Objective-C Runtime API, you include
#include <stdio.h>
#include <string.h>
-#if __has_attribute(objc_root_class)
-__attribute__((objc_root_class))
-#endif
@interface MyRootClass
{ Class isa; }
+ alloc;
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* { dg-additional-options "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */
/* To get the modern GNU Objective-C Runtime API, you include
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
systems that don't have the V2 APis). XFAILing the run is not useful
since it will XPASS on the sub-set that works. */
/* { dg-skip-if "Incompatible" { *-*-darwin* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
/* { dg-do run } */
/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* To get the modern GNU Objective-C Runtime API, you include
objc/runtime.h. */
enum type1;
struct type2;
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyObject
- (void) method1: (enum type1)argument;
- (void) method2: (struct type2)argument;
extern id class_createInstance (id, int);
extern id class_getSuperclass (id);
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyObject
{
Class isa;
/* Test that using an invalid type in a method declaration produces a
friendly error without a compiler crash. */
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyClass
@end
/* { dg-do compile } */
#include <objc/objc.h>
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyRootClass
{
Class isa;
#include <stdlib.h>
#include <objc/objc.h>
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyRootClass1
{
Class isa;
@end
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyRootClass2
{
Class isa;
/* { dg-do compile } */
#include <objc/objc.h>
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyClass
{
int someivar;
/* { dg-additional-options "-fno-local-ivars" } */
#include <objc/objc.h>
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyClass
{
int someivar;
/* Test instance variable scope. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do run } */
-/* { dg-additional-options "-Wno-shadow-ivar -fno-local-ivars" } */
+/* { dg-additional-options "-Wno-shadow-ivar -fno-local-ivars -Wno-objc-root-class" } */
+
#include "../objc-obj-c++-shared/runtime.h"
#include <objc/objc.h>
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
-/* { dg-additional-options "-fivar-visibility=protected" } */
+/* { dg-additional-options "-fivar-visibility=protected -Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
-/* { dg-additional-options "-fivar-visibility=private" } */
+/* { dg-additional-options "-fivar-visibility=private -Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
/* Test instance variable visibility. */
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
-/* { dg-additional-options "-fivar-visibility=public" } */
+/* { dg-additional-options "-fivar-visibility=public -Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
/* Test for hiding of ivars by local variables. */
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Sprite {
int a;
global LTO_OPTIONS
set LTO_OPTIONS [list \
- {-O0 -flto -fgnu-runtime} \
- {-O2 -flto -fgnu-runtime} \
- {-O0 -flto -flto-partition=none -fgnu-runtime} \
- {-O2 -flto -flto-partition=none -fgnu-runtime} \
+ {-O0 -flto -fgnu-runtime -Wno-objc-root-class} \
+ {-O2 -flto -fgnu-runtime -Wno-objc-root-class } \
+ {-O0 -flto -flto-partition=none -fgnu-runtime -Wno-objc-root-class} \
+ {-O2 -flto -flto-partition=none -fgnu-runtime -Wno-objc-root-class} \
]
objc_init
# darwin targets can also run code with the NeXT runtime.
if [istarget "*-*-darwin*" ] {
set LTO_OPTIONS [list \
- {-O0 -flto -fnext-runtime} \
- {-O2 -flto -fnext-runtime} \
- {-O0 -flto -flto-partition=none -fnext-runtime} \
- {-O2 -flto -flto-partition=none -fnext-runtime} \
+ {-O0 -flto -fnext-runtime -Wno-objc-root-class} \
+ {-O2 -flto -fnext-runtime -Wno-objc-root-class} \
+ {-O0 -flto -flto-partition=none -fnext-runtime -Wno-objc-root-class} \
+ {-O2 -flto -flto-partition=none -fnext-runtime -Wno-objc-root-class} \
]
foreach src $tests {
# If we're only testing specific files and this isn't one of them, skip it.
/* { dg-lto-do run } */
-/* { dg-skip-if "" { "*-*-darwin*" && lp64 } } */
+
extern int printf (char *,...) ;
typedef struct objc_class *Class;
struct objc_class {
Class isa;
/* other stuff... */
-} ;
+};
@interface myRootObject {
@public
/* Tests of duplication. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface class1
- (int) meth1; /* { dg-message "previous declaration" } */
/* Contributed by Igor Seleznev <selez@mail.ru>. */
/* This used to be broken. */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include "../objc-obj-c++-shared/runtime.h"
used as method selectors. */
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo
- (void)insertNewButtonImage:(Foo *)newButtonImage in:(Foo *)buttonCell;
In addition to not crashing :-), the compiler should properly handle
valid protocol references, even when they're mixed with invalid ones. */
/* { dg-do compile } */
-
+/* { dg-additional-options "-Wno-objc-root-class" } */
+
#include <objc/objc.h>
@protocol DefinedProtocol
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-skip-if "" { *-*-* } { "-fobjc-abi-version=1" } { "" } } */
/* { dg-options "-fobjc-abi-version=0" { target { *-*-darwin* && { ! lp64 } } } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface FooBar
- (void)boo;
/* Syntax check for the new foreach statement. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_class *Class;
/* Syntax check for the new foreach statement. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_class *Class;
/* Syntax check for the new foreach statement.
Use of declaration in loop-header without requiring c99 mode. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_class *Class;
/* Test to make sure that file name does not appear in the binary. */
/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Test if compiler detects object as an parameter to a method
or not. It is not valid. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface foo
@end
# unlikely to make any difference to PCH. However, we do want to
# add -O0 -g, since users who want PCH usually want debugging and quick
# compiles.
- dg-flags-pch $subdir $test "-fgnu-runtime" $mytorture ".h"
+ dg-flags-pch $subdir $test "-fgnu-runtime -Wno-objc-root-class" $mytorture ".h"
}
if [istarget "*-*-darwin*" ] {
# unlikely to make any difference to PCH. However, we do want to
# add -O0 -g, since users who want PCH usually want debugging and quick
# compiles.
- dg-flags-pch $subdir $test "-fnext-runtime" $mytorture ".h"
+ dg-flags-pch $subdir $test "-fnext-runtime -Wno-objc-root-class" $mytorture ".h"
}
}
/* { dg-do compile } */
-/* { dg-options "-O -fdiagnostics-show-caret" } */
+/* { dg-options "-O -fdiagnostics-show-caret -Wno-objc-root-class" } */
/* This file is similar to diagnostic-test-expressions-1.c
(see the notes in that file); this file adds test
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface A
+(void)method: (int)parameter {} /* { dg-error "expected" } */
/* Test errors for accessing @private and @protected variables. */
/* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
/* Test warnings for shadowing instance variables. */
/* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MySuperClass
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
# Main loop.
-dg-runtest $tests "-fgnu-runtime" $DEFAULT_CFLAGS
+dg-runtest $tests "-fgnu-runtime -Wno-objc-root-class" $DEFAULT_CFLAGS
# Darwin targets can also run code with the NeXT runtime.
# but Properties are not supported by the runtime lib before Darwin 9.
if [istarget "*-*-darwin\[9123\]*" ] {
- dg-runtest $tests "-fnext-runtime" $DEFAULT_CFLAGS
+ dg-runtest $tests "-fnext-runtime -Wno-objc-root-class" $DEFAULT_CFLAGS
}
# All done.
/* Test for handling of protocol hierarchies. */
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* One-line substitute for objc/objc.h */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
/* Test protocol warning. */
/* Contributed by Devang Patel <dpatel@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
may be lost, leading to superfluous warnings. */
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* One-line substitute for objc/objc.h */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
/* Do not lose references to forward-declared protocols. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@class MyBaseClass;
@class MyClassThatFails;
@protocol _MyProtocol;
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include "../objc-obj-c++-shared/runtime.h"
#include <objc/Protocol.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
/* { dg-options "-Wno-protocol" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* { dg-options "-Wselector" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
typedef struct objc_selector *SEL;
/* Test that we don't ICE when issuing a -Wselector warning. */
/* { dg-options "-Wselector" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* { dg-options "-Wselector" } */
/* { dg-do compile } */
/* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
typedef const struct objc_selector *SEL;
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Int1
+ (int)and_eq:(int)arg1 and:(int)arg2;
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
/* { dg-additional-options "-Wno-shadow-ivar" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MyClass
/* Author: Dimitris Papavasiliou <dpapavas@gmail.com>. */
/* { dg-do compile } */
/* { dg-additional-options "-Wno-shadow" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
@interface MyClass
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <stdlib.h>
#include <objc/objc.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <stdio.h>
#include <stdlib.h>
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* This test is identical to load-category-2, but the classes and
categories are created in inverted order in the modules, to test
# for all systems we point to the libobjc includes and use the -fgnu-runtime
set add_flags "additional_flags=-I${srcdir}/../../libobjc"
lappend add_flags "additional_flags=-fgnu-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/unclaimed-category-1a.m" "unclaimed-category-1a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "unclaimed-category-1a.o"
if [istarget "*-*-darwin*" ] {
set add_flags ""
lappend add_flags "additional_flags=-fnext-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/unclaimed-category-1a.m" "unclaimed-category-1a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "unclaimed-category-1a.o"
# and load-category-1a.m, link them together, and execute the result.
set add_flags "additional_flags=-I${srcdir}/../../libobjc"
lappend add_flags "additional_flags=-fgnu-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-1a.m" "load-category-1a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-1a.o"
if [istarget "*-*-darwin*" ] {
set add_flags ""
lappend add_flags "additional_flags=-fnext-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-1a.m" "load-category-1a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-1a.o"
# and load-category-2a.m, link them together, and execute the result.
set add_flags "additional_flags=-I${srcdir}/../../libobjc"
lappend add_flags "additional_flags=-fgnu-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-2a.m" "load-category-2a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-2a.o"
if [istarget "*-*-darwin*" ] {
set add_flags ""
lappend add_flags "additional_flags=-fnext-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-2a.m" "load-category-2a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-2a.o"
# and load-category-3a.m, link them together, and execute the result.
set add_flags "additional_flags=-I${srcdir}/../../libobjc"
lappend add_flags "additional_flags=-fgnu-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-3a.m" "load-category-3a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-3a.o"
if [istarget "*-*-darwin*" ] {
set add_flags ""
lappend add_flags "additional_flags=-fnext-runtime"
+lappend add_flags "additional_flags=-Wno-objc-root-class"
set lines [objc_target_compile "$srcdir/$subdir/load-category-3a.m" "load-category-3a.o" object $add_flags ]
if ![string match "" $lines] then {
fail "load-category-3a.o"
/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test loading unclaimed categories - categories of a class defined
separately from the class itself. */
/* Contributed by Nicola Pero - Fri Dec 14 08:36:00 GMT 2001 */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
#include "../../objc-obj-c++-shared/runtime.h"
/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface MyClass
+ newWithArg: arg;
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
# Main loop.
-dg-runtest $tests "-fgnu-runtime" $DEFAULT_CFLAGS
+dg-runtest $tests "-fgnu-runtime -Wno-objc-root-class" $DEFAULT_CFLAGS
# darwin targets can also run code with the NeXT runtime.
if [istarget "*-*-darwin*" ] {
- dg-runtest $tests "-fnext-runtime" $DEFAULT_CFLAGS
+ dg-runtest $tests "-fnext-runtime -Wno-objc-root-class" $DEFAULT_CFLAGS
}
# All done.
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { } *id ;
int x = 41 ;
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4 -msymbol-stubs" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { } *id ;
int x = 41 ;
/* Test calling super from within a category class method. */
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_object { struct objc_class *isa; } *id;
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
void *isa;
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
void *isa;
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010. */
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test that the compiler is checking the argument of @synchronized(),
and produce errors when invalid types are used. */
/* { dg-do run { target *-*-darwin* } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <stdio.h>
#include <string.h>
# Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
-objc-dg-runtest $tests "" "-fgnu-runtime"
+objc-dg-runtest $tests "" "-fgnu-runtime -Wno-objc-root-class"
# darwin targets can also run code with the NeXT runtime.
if [istarget "*-*-darwin*" ] {
- objc-dg-runtest $tests "" "-fnext-runtime"
+ objc-dg-runtest $tests "" "-fnext-runtime -Wno-objc-root-class"
}
dg-finish
# Gather a list of all tests.
set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
-objc-dg-runtest $tests "" "-fgnu-runtime"
+objc-dg-runtest $tests "" "-fgnu-runtime -Wno-objc-root-class"
# Darwin targets also test with the NeXT runtime.
if [istarget "*-*-darwin*" ] {
- objc-dg-runtest $tests "" "-fnext-runtime"
+ objc-dg-runtest $tests "" "-fnext-runtime -Wno-objc-root-class"
}
dg-finish
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef volatile int IOSharedLockData;
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface TestMyTests
- (void) testSpoon;
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include "../objc-obj-c++-shared/runtime.h"
#include <stdio.h>
/* Reject ivars that use flexible array members. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct
{
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
/* PR objc/47832 */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct
{
/* Reject ivars that use flexible array members. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct
{
/* Author: Nicola Pero <nicola@brainstorm.co.uk>. */
/* { dg-do compile } */
/* { dg-options "-Wundeclared-selector" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
/* Test for proper handling of volatile parameters in ObjC methods. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Test
-(void) test2: (volatile int) a;