aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-11-12 13:11:11 +0000
committerIain Sandoe <iain@sandoe.co.uk>2020-11-13 10:40:54 +0000
commitd35fbf7f7673b5c72ee61720f1a209d4e798152f (patch)
tree12118de58101ac5ca2dfe9c8f34a39e2461a4cd2 /gcc
parent3fe07cdec8c79bce53ea5aeb8e607df6eb5c8c2c (diff)
downloadgcc-d35fbf7f7673b5c72ee61720f1a209d4e798152f.zip
gcc-d35fbf7f7673b5c72ee61720f1a209d4e798152f.tar.gz
gcc-d35fbf7f7673b5c72ee61720f1a209d4e798152f.tar.bz2
Objective-C [2/3] : Implement Wobjc-root-class [PR77404].
Add "Wno-objc-root-class" to tests in the Objective-C suite where needed. gcc/testsuite/ChangeLog: PR objc/77404 * objc.dg/anon-1.m: Add Wno-objc-root-class. * objc.dg/attributes/class-attribute-1.m: Likewise. * objc.dg/attributes/class-attribute-2.m: Likewise. * objc.dg/attributes/class-attribute-3.m: Likewise. * objc.dg/attributes/method-deprecated-1.m: Likewise. * objc.dg/attributes/method-deprecated-2.m: Likewise. * objc.dg/attributes/method-deprecated-3.m: Likewise. * objc.dg/attributes/method-format-1.m: Likewise. * objc.dg/attributes/method-nonnull-1.m: Likewise. * objc.dg/attributes/method-noreturn-1.m: Likewise. * objc.dg/attributes/method-sentinel-1.m: Likewise. * objc.dg/attributes/nsobject-01.m: Likewise. * objc.dg/attributes/objc-exception-1.m: Likewise. * objc.dg/attributes/parameter-attribute-1.m: Likewise. * objc.dg/attributes/parameter-attribute-2.m: Likewise. * objc.dg/attributes/proto-attribute-1.m: Likewise. * objc.dg/attributes/proto-attribute-2.m: Likewise. * objc.dg/attributes/proto-attribute-3.m: Likewise. * objc.dg/attributes/proto-attribute-4.m: Likewise. * objc.dg/bitfield-2.m: Likewise. * objc.dg/break-in-ifstmt.m: Likewise. * objc.dg/class-1.m: Likewise. * objc.dg/class-extension-1.m: Likewise. * objc.dg/class-extension-2.m: Likewise. * objc.dg/class-extension-3.m: Likewise. * objc.dg/class-extension-4.m: Likewise. * objc.dg/class-protocol-1.m: Likewise. * objc.dg/comp-types-7.m: Likewise. * objc.dg/demangle-1.m: Likewise. * objc.dg/duplicate-class-1.m: Likewise. * objc.dg/encode-6-next.m: Likewise. * objc.dg/encode-6.m: Likewise. * objc.dg/enhanced-proto-2.m: Likewise. * objc.dg/exceptions-1.m: Likewise. * objc.dg/exceptions-3.m: Likewise. * objc.dg/exceptions-4.m: Likewise. * objc.dg/exceptions-5.m: Likewise. * objc.dg/fobjc-std-1.m: Likewise. * objc.dg/foreach-2.m: Likewise. * objc.dg/foreach-4.m: Likewise. * objc.dg/foreach-5.m: Likewise. * objc.dg/fsyntax-only.m: Likewise. * objc.dg/gnu-api-2-class-meta.m: Likewise. * objc.dg/gnu-api-2-class.m: Likewise. * objc.dg/gnu-api-2-ivar.m: Likewise. * objc.dg/gnu-api-2-method.m: Likewise. * objc.dg/gnu-api-2-objc.m: Likewise. * objc.dg/gnu-api-2-objc_msg_lookup.m: Likewise. * objc.dg/gnu-api-2-object.m: Likewise. * objc.dg/gnu-api-2-property.m: Likewise. * objc.dg/gnu-api-2-protocol.m: Likewise. * objc.dg/gnu-api-2-resolve-method.m: Likewise. * objc.dg/gnu-api-2-sel.m: Likewise. * objc.dg/incomplete-type-1.m: Likewise. * objc.dg/instancetype-0.m: Likewise. * objc.dg/invalid-method-2.m: Likewise. * objc.dg/ivar-invalid-type-1.m: Likewise. * objc.dg/ivar-problem-1.m: Likewise. * objc.dg/ivar-scope-1.m: Likewise. * objc.dg/ivar-scope-2.m: Likewise. * objc.dg/ivar-scope-4.m: Likewise. * objc.dg/ivar-visibility-1.m: Likewise. * objc.dg/ivar-visibility-2.m: Likewise. * objc.dg/ivar-visibility-3.m: Likewise. * objc.dg/ivar-visibility-4.m: Likewise. * objc.dg/local-decl-1.m: Likewise. * objc.dg/lto/lto.exp: Likewise. * objc.dg/lto/trivial-1_0.m: Likewise. * objc.dg/method-1.m: Likewise. * objc.dg/method-12.m: Likewise. * objc.dg/method-13.m: Likewise. * objc.dg/method-14.m: Likewise. * objc.dg/missing-proto-3.m: Likewise. * objc.dg/next-runtime-1.m: Likewise. * objc.dg/objc-foreach-1.m: Likewise. * objc.dg/objc-foreach-2.m: Likewise. * objc.dg/objc-foreach-3.m: Likewise. * objc.dg/objc-nofilename-1.m: Likewise. * objc.dg/param-1.m: Likewise. * objc.dg/pch/pch.exp: Likewise. * objc.dg/plugin/diagnostic-test-expressions-1.m: Likewise. * objc.dg/pr23709.m: Likewise. * objc.dg/private-1.m: Likewise. * objc.dg/private-2.m: Likewise. * objc.dg/property/property.exp: Likewise. * objc.dg/proto-hier-1.m: Likewise. * objc.dg/proto-hier-2.m: Likewise. * objc.dg/proto-lossage-1.m: Likewise. * objc.dg/proto-lossage-5.m: Likewise. * objc.dg/proto-qual-1.m: Likewise. * objc.dg/protocol-inheritance-1.m: Likewise. * objc.dg/protocol-inheritance-2.m: Likewise. * objc.dg/protocol-optional-1.m: Likewise. * objc.dg/selector-1.m: Likewise. * objc.dg/selector-2.m: Likewise. * objc.dg/selector-3.m: Likewise. * objc.dg/selector-4.m: Likewise. * objc.dg/shadow-1.m: Likewise. * objc.dg/shadow-2.m: Likewise. * objc.dg/special/load-category-1.m: Likewise. * objc.dg/special/load-category-2.m: Likewise. * objc.dg/special/load-category-3.m: Likewise. * objc.dg/special/special.exp: Likewise. * objc.dg/special/unclaimed-category-1.h: Likewise. * objc.dg/special/unclaimed-category-1.m: Likewise. * objc.dg/stabs-1.m: Likewise. * objc.dg/strings/strings.exp: Likewise. * objc.dg/stubify-1.m: Likewise. * objc.dg/stubify-2.m: Likewise. * objc.dg/super-class-2.m: Likewise. * objc.dg/super-dealloc-1.m: Likewise. * objc.dg/super-dealloc-2.m: Likewise. * objc.dg/sync-3.m: Likewise. * objc.dg/threedotthree-abi-1.m: Likewise. * objc.dg/torture/dg-torture.exp: Likewise. * objc.dg/torture/strings/strings.exp: Likewise. * objc.dg/try-catch-11.m: Likewise. * objc.dg/try-catch-12.m: Likewise. * objc.dg/type-size-2.m: Likewise. * objc.dg/type-size-3.m: Likewise. * objc.dg/type-size-4.m: Likewise. * objc.dg/type-size-5.m: Likewise. * objc.dg/undeclared-selector.m: Likewise. * objc.dg/volatile-1.m: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/objc.dg/anon-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/class-attribute-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/class-attribute-2.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/class-attribute-3.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-deprecated-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-deprecated-2.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-deprecated-3.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-format-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-nonnull-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-noreturn-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-sentinel-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/nsobject-01.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/objc-exception-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/parameter-attribute-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-2.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-3.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-4.m1
-rw-r--r--gcc/testsuite/objc.dg/bitfield-2.m1
-rw-r--r--gcc/testsuite/objc.dg/break-in-ifstmt.m1
-rw-r--r--gcc/testsuite/objc.dg/class-1.m4
-rw-r--r--gcc/testsuite/objc.dg/class-extension-1.m1
-rw-r--r--gcc/testsuite/objc.dg/class-extension-2.m1
-rw-r--r--gcc/testsuite/objc.dg/class-extension-3.m1
-rw-r--r--gcc/testsuite/objc.dg/class-extension-4.m1
-rw-r--r--gcc/testsuite/objc.dg/class-protocol-1.m1
-rw-r--r--gcc/testsuite/objc.dg/comp-types-7.m1
-rw-r--r--gcc/testsuite/objc.dg/demangle-1.m1
-rw-r--r--gcc/testsuite/objc.dg/duplicate-class-1.m1
-rw-r--r--gcc/testsuite/objc.dg/encode-6-next.m1
-rw-r--r--gcc/testsuite/objc.dg/encode-6.m1
-rw-r--r--gcc/testsuite/objc.dg/enhanced-proto-2.m1
-rw-r--r--gcc/testsuite/objc.dg/exceptions-1.m1
-rw-r--r--gcc/testsuite/objc.dg/exceptions-3.m1
-rw-r--r--gcc/testsuite/objc.dg/exceptions-4.m1
-rw-r--r--gcc/testsuite/objc.dg/exceptions-5.m1
-rw-r--r--gcc/testsuite/objc.dg/fobjc-std-1.m5
-rw-r--r--gcc/testsuite/objc.dg/foreach-2.m1
-rw-r--r--gcc/testsuite/objc.dg/foreach-4.m1
-rw-r--r--gcc/testsuite/objc.dg/foreach-5.m1
-rw-r--r--gcc/testsuite/objc.dg/fsyntax-only.m3
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-class-meta.m4
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-class.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-ivar.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-method.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-objc.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-objc_msg_lookup.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-object.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-property.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-protocol.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-resolve-method.m1
-rw-r--r--gcc/testsuite/objc.dg/gnu-api-2-sel.m1
-rw-r--r--gcc/testsuite/objc.dg/incomplete-type-1.m3
-rw-r--r--gcc/testsuite/objc.dg/instancetype-0.m3
-rw-r--r--gcc/testsuite/objc.dg/invalid-method-2.m3
-rw-r--r--gcc/testsuite/objc.dg/ivar-invalid-type-1.m3
-rw-r--r--gcc/testsuite/objc.dg/ivar-problem-1.m6
-rw-r--r--gcc/testsuite/objc.dg/ivar-scope-1.m3
-rw-r--r--gcc/testsuite/objc.dg/ivar-scope-2.m3
-rw-r--r--gcc/testsuite/objc.dg/ivar-scope-4.m3
-rw-r--r--gcc/testsuite/objc.dg/ivar-visibility-1.m1
-rw-r--r--gcc/testsuite/objc.dg/ivar-visibility-2.m2
-rw-r--r--gcc/testsuite/objc.dg/ivar-visibility-3.m2
-rw-r--r--gcc/testsuite/objc.dg/ivar-visibility-4.m2
-rw-r--r--gcc/testsuite/objc.dg/local-decl-1.m1
-rw-r--r--gcc/testsuite/objc.dg/lto/lto.exp16
-rw-r--r--gcc/testsuite/objc.dg/lto/trivial-1_0.m4
-rw-r--r--gcc/testsuite/objc.dg/method-1.m1
-rw-r--r--gcc/testsuite/objc.dg/method-12.m1
-rw-r--r--gcc/testsuite/objc.dg/method-13.m1
-rw-r--r--gcc/testsuite/objc.dg/method-14.m1
-rw-r--r--gcc/testsuite/objc.dg/missing-proto-3.m3
-rw-r--r--gcc/testsuite/objc.dg/next-runtime-1.m1
-rw-r--r--gcc/testsuite/objc.dg/objc-foreach-1.m1
-rw-r--r--gcc/testsuite/objc.dg/objc-foreach-2.m1
-rw-r--r--gcc/testsuite/objc.dg/objc-foreach-3.m1
-rw-r--r--gcc/testsuite/objc.dg/objc-nofilename-1.m1
-rw-r--r--gcc/testsuite/objc.dg/param-1.m1
-rw-r--r--gcc/testsuite/objc.dg/pch/pch.exp4
-rw-r--r--gcc/testsuite/objc.dg/plugin/diagnostic-test-expressions-1.m2
-rw-r--r--gcc/testsuite/objc.dg/pr23709.m1
-rw-r--r--gcc/testsuite/objc.dg/private-1.m1
-rw-r--r--gcc/testsuite/objc.dg/private-2.m1
-rw-r--r--gcc/testsuite/objc.dg/property/property.exp4
-rw-r--r--gcc/testsuite/objc.dg/proto-hier-1.m1
-rw-r--r--gcc/testsuite/objc.dg/proto-hier-2.m1
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-1.m1
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-5.m1
-rw-r--r--gcc/testsuite/objc.dg/proto-qual-1.m1
-rw-r--r--gcc/testsuite/objc.dg/protocol-inheritance-1.m1
-rw-r--r--gcc/testsuite/objc.dg/protocol-inheritance-2.m1
-rw-r--r--gcc/testsuite/objc.dg/protocol-optional-1.m1
-rw-r--r--gcc/testsuite/objc.dg/selector-1.m1
-rw-r--r--gcc/testsuite/objc.dg/selector-2.m1
-rw-r--r--gcc/testsuite/objc.dg/selector-3.m1
-rw-r--r--gcc/testsuite/objc.dg/selector-4.m1
-rw-r--r--gcc/testsuite/objc.dg/shadow-1.m1
-rw-r--r--gcc/testsuite/objc.dg/shadow-2.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-1.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-2.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-3.m1
-rw-r--r--gcc/testsuite/objc.dg/special/special.exp8
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.h1
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.m1
-rw-r--r--gcc/testsuite/objc.dg/stabs-1.m1
-rw-r--r--gcc/testsuite/objc.dg/strings/strings.exp4
-rw-r--r--gcc/testsuite/objc.dg/stubify-1.m1
-rw-r--r--gcc/testsuite/objc.dg/stubify-2.m1
-rw-r--r--gcc/testsuite/objc.dg/super-class-2.m1
-rw-r--r--gcc/testsuite/objc.dg/super-dealloc-1.m1
-rw-r--r--gcc/testsuite/objc.dg/super-dealloc-2.m1
-rw-r--r--gcc/testsuite/objc.dg/sync-3.m1
-rw-r--r--gcc/testsuite/objc.dg/threedotthree-abi-1.m1
-rw-r--r--gcc/testsuite/objc.dg/torture/dg-torture.exp4
-rw-r--r--gcc/testsuite/objc.dg/torture/strings/strings.exp4
-rw-r--r--gcc/testsuite/objc.dg/try-catch-11.m1
-rw-r--r--gcc/testsuite/objc.dg/try-catch-12.m1
-rw-r--r--gcc/testsuite/objc.dg/type-size-2.m1
-rw-r--r--gcc/testsuite/objc.dg/type-size-3.m1
-rw-r--r--gcc/testsuite/objc.dg/type-size-4.m1
-rw-r--r--gcc/testsuite/objc.dg/type-size-5.m1
-rw-r--r--gcc/testsuite/objc.dg/undeclared-selector.m1
-rw-r--r--gcc/testsuite/objc.dg/volatile-1.m3
124 files changed, 171 insertions, 32 deletions
diff --git a/gcc/testsuite/objc.dg/anon-1.m b/gcc/testsuite/objc.dg/anon-1.m
index 5f10f7d..5dab3fa 100644
--- a/gcc/testsuite/objc.dg/anon-1.m
+++ b/gcc/testsuite/objc.dg/anon-1.m
@@ -1,5 +1,6 @@
/* Test for graceful handling of anonymous ivars. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
unsigned char : 1;
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-1.m b/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
index 3444760..93e5d7f 100644
--- a/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
+++ b/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
/* Test deprecate attribute with an @interface declaration. */
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-2.m b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
index 2e1bacb..f8137ff 100644
--- a/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
+++ b/gcc/testsuite/objc.dg/attributes/class-attribute-2.m
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-3.m b/gcc/testsuite/objc.dg/attributes/class-attribute-3.m
index 6cc5d4e..7c3b3b0 100644
--- a/gcc/testsuite/objc.dg/attributes/class-attribute-3.m
+++ b/gcc/testsuite/objc.dg/attributes/class-attribute-3.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/attributes/method-deprecated-1.m b/gcc/testsuite/objc.dg/attributes/method-deprecated-1.m
index 8343856..68e8373 100644
--- a/gcc/testsuite/objc.dg/attributes/method-deprecated-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-deprecated-1.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m b/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m
index 1e5d87f..8fb0e15 100644
--- a/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m
+++ b/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m b/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m
index 5c715a2..efa2d34 100644
--- a/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m
+++ b/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-format-1.m b/gcc/testsuite/objc.dg/attributes/method-format-1.m
index 9ff34f9..d3bb997 100644
--- a/gcc/testsuite/objc.dg/attributes/method-format-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-format-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m b/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
index fe5f885..a3bfd9b 100644
--- a/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
index a83048b..413a0be 100644
--- a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m b/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
index e2abb1e..f89c981 100644
--- a/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/nsobject-01.m b/gcc/testsuite/objc.dg/attributes/nsobject-01.m
index 5b56849..1f33150 100644
--- a/gcc/testsuite/objc.dg/attributes/nsobject-01.m
+++ b/gcc/testsuite/objc.dg/attributes/nsobject-01.m
@@ -1,5 +1,6 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/attributes/objc-exception-1.m b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m
index e7f6f85..19e5ade 100644
--- a/gcc/testsuite/objc.dg/attributes/objc-exception-1.m
+++ b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/attributes/parameter-attribute-1.m b/gcc/testsuite/objc.dg/attributes/parameter-attribute-1.m
index 8263df6..d6ebaf2 100644
--- a/gcc/testsuite/objc.dg/attributes/parameter-attribute-1.m
+++ b/gcc/testsuite/objc.dg/attributes/parameter-attribute-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m b/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m
index 99c5a30..637846d 100644
--- a/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m
+++ b/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m
@@ -1,5 +1,6 @@
/* Test that we get warnings for unrecognized attributes. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m
index a852a7a..03726dc 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
index b23b81d..6a73d24 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
index 2be286e..ad6d0c8 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-4.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-4.m
index 226fd68..8d34ebd 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-4.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-4.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/bitfield-2.m b/gcc/testsuite/objc.dg/bitfield-2.m
index 7e8147a..b28c81e 100644
--- a/gcc/testsuite/objc.dg/bitfield-2.m
+++ b/gcc/testsuite/objc.dg/bitfield-2.m
@@ -4,6 +4,7 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/break-in-ifstmt.m b/gcc/testsuite/objc.dg/break-in-ifstmt.m
index 8968494..6176832 100644
--- a/gcc/testsuite/objc.dg/break-in-ifstmt.m
+++ b/gcc/testsuite/objc.dg/break-in-ifstmt.m
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface foo
- (void) test;
diff --git a/gcc/testsuite/objc.dg/class-1.m b/gcc/testsuite/objc.dg/class-1.m
index 0504937..64383f2 100644
--- a/gcc/testsuite/objc.dg/class-1.m
+++ b/gcc/testsuite/objc.dg/class-1.m
@@ -1,5 +1,6 @@
/* Redeclarations of class names. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef int foo; /* { dg-line foo_def } */
@@ -8,6 +9,9 @@ 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 } */
diff --git a/gcc/testsuite/objc.dg/class-extension-1.m b/gcc/testsuite/objc.dg/class-extension-1.m
index 5c89a98..9d6658a 100644
--- a/gcc/testsuite/objc.dg/class-extension-1.m
+++ b/gcc/testsuite/objc.dg/class-extension-1.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/class-extension-2.m b/gcc/testsuite/objc.dg/class-extension-2.m
index 7f55b60..293facb1 100644
--- a/gcc/testsuite/objc.dg/class-extension-2.m
+++ b/gcc/testsuite/objc.dg/class-extension-2.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/class-extension-3.m b/gcc/testsuite/objc.dg/class-extension-3.m
index 69e5705..51fe5ee 100644
--- a/gcc/testsuite/objc.dg/class-extension-3.m
+++ b/gcc/testsuite/objc.dg/class-extension-3.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/class-extension-4.m b/gcc/testsuite/objc.dg/class-extension-4.m
index 692a0fc..5d367d4 100644
--- a/gcc/testsuite/objc.dg/class-extension-4.m
+++ b/gcc/testsuite/objc.dg/class-extension-4.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/class-protocol-1.m b/gcc/testsuite/objc.dg/class-protocol-1.m
index 59c8f82..34680c2 100644
--- a/gcc/testsuite/objc.dg/class-protocol-1.m
+++ b/gcc/testsuite/objc.dg/class-protocol-1.m
@@ -1,6 +1,7 @@
/* 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"
diff --git a/gcc/testsuite/objc.dg/comp-types-7.m b/gcc/testsuite/objc.dg/comp-types-7.m
index 526934f..6b796f0 100644
--- a/gcc/testsuite/objc.dg/comp-types-7.m
+++ b/gcc/testsuite/objc.dg/comp-types-7.m
@@ -1,4 +1,5 @@
/* { 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]. */
diff --git a/gcc/testsuite/objc.dg/demangle-1.m b/gcc/testsuite/objc.dg/demangle-1.m
index 42b79a9..61e79a6 100644
--- a/gcc/testsuite/objc.dg/demangle-1.m
+++ b/gcc/testsuite/objc.dg/demangle-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/duplicate-class-1.m b/gcc/testsuite/objc.dg/duplicate-class-1.m
index 30a18ff..7992ebf 100644
--- a/gcc/testsuite/objc.dg/duplicate-class-1.m
+++ b/gcc/testsuite/objc.dg/duplicate-class-1.m
@@ -1,5 +1,6 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/encode-6-next.m b/gcc/testsuite/objc.dg/encode-6-next.m
index c3d9226..18ee15d 100644
--- a/gcc/testsuite/objc.dg/encode-6-next.m
+++ b/gcc/testsuite/objc.dg/encode-6-next.m
@@ -2,6 +2,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/encode-6.m b/gcc/testsuite/objc.dg/encode-6.m
index 291a41e..9e9e492 100644
--- a/gcc/testsuite/objc.dg/encode-6.m
+++ b/gcc/testsuite/objc.dg/encode-6.m
@@ -2,6 +2,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/enhanced-proto-2.m b/gcc/testsuite/objc.dg/enhanced-proto-2.m
index c196b51..ca99445 100644
--- a/gcc/testsuite/objc.dg/enhanced-proto-2.m
+++ b/gcc/testsuite/objc.dg/enhanced-proto-2.m
@@ -1,5 +1,6 @@
/* Test use of @optional/@required keywords in @protocol class. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@protocol MyProto1
@optional
diff --git a/gcc/testsuite/objc.dg/exceptions-1.m b/gcc/testsuite/objc.dg/exceptions-1.m
index 0f3b7e8..1e86177 100644
--- a/gcc/testsuite/objc.dg/exceptions-1.m
+++ b/gcc/testsuite/objc.dg/exceptions-1.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/exceptions-3.m b/gcc/testsuite/objc.dg/exceptions-3.m
index 69a6494..bedaf53 100644
--- a/gcc/testsuite/objc.dg/exceptions-3.m
+++ b/gcc/testsuite/objc.dg/exceptions-3.m
@@ -1,6 +1,7 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/exceptions-4.m b/gcc/testsuite/objc.dg/exceptions-4.m
index bbdb741..5d77ffa 100644
--- a/gcc/testsuite/objc.dg/exceptions-4.m
+++ b/gcc/testsuite/objc.dg/exceptions-4.m
@@ -1,6 +1,7 @@
/* 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(). */
diff --git a/gcc/testsuite/objc.dg/exceptions-5.m b/gcc/testsuite/objc.dg/exceptions-5.m
index 55ef0f3..31796bc 100644
--- a/gcc/testsuite/objc.dg/exceptions-5.m
+++ b/gcc/testsuite/objc.dg/exceptions-5.m
@@ -1,6 +1,7 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/fobjc-std-1.m b/gcc/testsuite/objc.dg/fobjc-std-1.m
index 9a15b8a..729f65c 100644
--- a/gcc/testsuite/objc.dg/fobjc-std-1.m
+++ b/gcc/testsuite/objc.dg/fobjc-std-1.m
@@ -1,6 +1,7 @@
/* 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>
@@ -29,8 +30,8 @@
@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
diff --git a/gcc/testsuite/objc.dg/foreach-2.m b/gcc/testsuite/objc.dg/foreach-2.m
index 93bc902..ccce557 100644
--- a/gcc/testsuite/objc.dg/foreach-2.m
+++ b/gcc/testsuite/objc.dg/foreach-2.m
@@ -6,6 +6,7 @@
/* { 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__
diff --git a/gcc/testsuite/objc.dg/foreach-4.m b/gcc/testsuite/objc.dg/foreach-4.m
index faee73b..2365609 100644
--- a/gcc/testsuite/objc.dg/foreach-4.m
+++ b/gcc/testsuite/objc.dg/foreach-4.m
@@ -6,6 +6,7 @@
/* { 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__
diff --git a/gcc/testsuite/objc.dg/foreach-5.m b/gcc/testsuite/objc.dg/foreach-5.m
index dce26fa..1bcb10b 100644
--- a/gcc/testsuite/objc.dg/foreach-5.m
+++ b/gcc/testsuite/objc.dg/foreach-5.m
@@ -6,6 +6,7 @@
/* { 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__
diff --git a/gcc/testsuite/objc.dg/fsyntax-only.m b/gcc/testsuite/objc.dg/fsyntax-only.m
index 54a879e..70ea8ac 100644
--- a/gcc/testsuite/objc.dg/fsyntax-only.m
+++ b/gcc/testsuite/objc.dg/fsyntax-only.m
@@ -2,6 +2,9 @@
/* { 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
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m b/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m
index 3a85b16..6c1c76a 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m
@@ -20,6 +20,7 @@
/* { 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
@@ -29,9 +30,6 @@
#include <stdio.h>
#include <string.h>
-#if __has_attribute(objc_root_class)
-__attribute__((objc_root_class))
-#endif
@interface MyRootClass
{ Class isa; }
+ alloc;
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-class.m b/gcc/testsuite/objc.dg/gnu-api-2-class.m
index eade0dc..d11dae0 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-class.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-class.m
@@ -7,6 +7,7 @@
/* { 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
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-ivar.m b/gcc/testsuite/objc.dg/gnu-api-2-ivar.m
index 19ac004..072d265 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-ivar.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-ivar.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-method.m b/gcc/testsuite/objc.dg/gnu-api-2-method.m
index 0c4fe4f..ea1da8d 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-method.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-method.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-objc.m b/gcc/testsuite/objc.dg/gnu-api-2-objc.m
index 1b4ce8e..e9ec5d7 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-objc.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-objc.m
@@ -9,6 +9,7 @@
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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-objc_msg_lookup.m b/gcc/testsuite/objc.dg/gnu-api-2-objc_msg_lookup.m
index 5751f3f..d417225 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-objc_msg_lookup.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-objc_msg_lookup.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-object.m b/gcc/testsuite/objc.dg/gnu-api-2-object.m
index 3d4d444..20c4342 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-object.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-object.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-property.m b/gcc/testsuite/objc.dg/gnu-api-2-property.m
index 12c0d8b9..0ef4d79 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-property.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-property.m
@@ -4,6 +4,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-protocol.m b/gcc/testsuite/objc.dg/gnu-api-2-protocol.m
index a34d74c..682adcd 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-protocol.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-protocol.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-resolve-method.m b/gcc/testsuite/objc.dg/gnu-api-2-resolve-method.m
index a387709..6eaa3dd 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-resolve-method.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-resolve-method.m
@@ -5,6 +5,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/gnu-api-2-sel.m b/gcc/testsuite/objc.dg/gnu-api-2-sel.m
index b71fdfa..bc581be 100644
--- a/gcc/testsuite/objc.dg/gnu-api-2-sel.m
+++ b/gcc/testsuite/objc.dg/gnu-api-2-sel.m
@@ -4,6 +4,7 @@
/* { 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. */
diff --git a/gcc/testsuite/objc.dg/incomplete-type-1.m b/gcc/testsuite/objc.dg/incomplete-type-1.m
index f1e875f..60d0d8a 100644
--- a/gcc/testsuite/objc.dg/incomplete-type-1.m
+++ b/gcc/testsuite/objc.dg/incomplete-type-1.m
@@ -6,6 +6,9 @@
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;
diff --git a/gcc/testsuite/objc.dg/instancetype-0.m b/gcc/testsuite/objc.dg/instancetype-0.m
index 32cafdf..dc27926 100644
--- a/gcc/testsuite/objc.dg/instancetype-0.m
+++ b/gcc/testsuite/objc.dg/instancetype-0.m
@@ -6,6 +6,9 @@
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;
diff --git a/gcc/testsuite/objc.dg/invalid-method-2.m b/gcc/testsuite/objc.dg/invalid-method-2.m
index cb18de9..0a4bd63 100644
--- a/gcc/testsuite/objc.dg/invalid-method-2.m
+++ b/gcc/testsuite/objc.dg/invalid-method-2.m
@@ -3,6 +3,9 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/ivar-invalid-type-1.m b/gcc/testsuite/objc.dg/ivar-invalid-type-1.m
index 3e7785d..98bf36e 100644
--- a/gcc/testsuite/objc.dg/ivar-invalid-type-1.m
+++ b/gcc/testsuite/objc.dg/ivar-invalid-type-1.m
@@ -1,6 +1,9 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/ivar-problem-1.m b/gcc/testsuite/objc.dg/ivar-problem-1.m
index 4a87768..0d5bb66 100644
--- a/gcc/testsuite/objc.dg/ivar-problem-1.m
+++ b/gcc/testsuite/objc.dg/ivar-problem-1.m
@@ -10,6 +10,9 @@
#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;
@@ -36,6 +39,9 @@
@end
+#if defined(__has_attribute) && __has_attribute(objc_root_class)
+__attribute__((objc_root_class))
+#endif
@interface MyRootClass2
{
Class isa;
diff --git a/gcc/testsuite/objc.dg/ivar-scope-1.m b/gcc/testsuite/objc.dg/ivar-scope-1.m
index 34443a4..64d275b 100644
--- a/gcc/testsuite/objc.dg/ivar-scope-1.m
+++ b/gcc/testsuite/objc.dg/ivar-scope-1.m
@@ -3,6 +3,9 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/ivar-scope-2.m b/gcc/testsuite/objc.dg/ivar-scope-2.m
index ff795d0..1149d73 100644
--- a/gcc/testsuite/objc.dg/ivar-scope-2.m
+++ b/gcc/testsuite/objc.dg/ivar-scope-2.m
@@ -4,6 +4,9 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/ivar-scope-4.m b/gcc/testsuite/objc.dg/ivar-scope-4.m
index 5fc29f9..df1c892 100644
--- a/gcc/testsuite/objc.dg/ivar-scope-4.m
+++ b/gcc/testsuite/objc.dg/ivar-scope-4.m
@@ -1,7 +1,8 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/ivar-visibility-1.m b/gcc/testsuite/objc.dg/ivar-visibility-1.m
index 5a22259..79d791e 100644
--- a/gcc/testsuite/objc.dg/ivar-visibility-1.m
+++ b/gcc/testsuite/objc.dg/ivar-visibility-1.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/ivar-visibility-2.m b/gcc/testsuite/objc.dg/ivar-visibility-2.m
index eb41c8f..6ddcb5b 100644
--- a/gcc/testsuite/objc.dg/ivar-visibility-2.m
+++ b/gcc/testsuite/objc.dg/ivar-visibility-2.m
@@ -1,7 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/ivar-visibility-3.m b/gcc/testsuite/objc.dg/ivar-visibility-3.m
index ecc6f99..6403503 100644
--- a/gcc/testsuite/objc.dg/ivar-visibility-3.m
+++ b/gcc/testsuite/objc.dg/ivar-visibility-3.m
@@ -1,7 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/ivar-visibility-4.m b/gcc/testsuite/objc.dg/ivar-visibility-4.m
index adfeb44..abd802b 100644
--- a/gcc/testsuite/objc.dg/ivar-visibility-4.m
+++ b/gcc/testsuite/objc.dg/ivar-visibility-4.m
@@ -1,7 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/local-decl-1.m b/gcc/testsuite/objc.dg/local-decl-1.m
index 4a4bfdf..8356a8c 100644
--- a/gcc/testsuite/objc.dg/local-decl-1.m
+++ b/gcc/testsuite/objc.dg/local-decl-1.m
@@ -1,6 +1,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/lto/lto.exp b/gcc/testsuite/objc.dg/lto/lto.exp
index e563ecb..8a362d6 100644
--- a/gcc/testsuite/objc.dg/lto/lto.exp
+++ b/gcc/testsuite/objc.dg/lto/lto.exp
@@ -41,10 +41,10 @@ if { ![check_effective_target_lto] } {
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
@@ -67,10 +67,10 @@ foreach src $tests {
# 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.
diff --git a/gcc/testsuite/objc.dg/lto/trivial-1_0.m b/gcc/testsuite/objc.dg/lto/trivial-1_0.m
index ba1b1aa..ca07fa4 100644
--- a/gcc/testsuite/objc.dg/lto/trivial-1_0.m
+++ b/gcc/testsuite/objc.dg/lto/trivial-1_0.m
@@ -1,5 +1,5 @@
/* { dg-lto-do run } */
-/* { dg-skip-if "" { "*-*-darwin*" && lp64 } } */
+
extern int printf (char *,...) ;
typedef struct objc_class *Class;
@@ -7,7 +7,7 @@ typedef struct objc_class *Class;
struct objc_class {
Class isa;
/* other stuff... */
-} ;
+};
@interface myRootObject {
@public
diff --git a/gcc/testsuite/objc.dg/method-1.m b/gcc/testsuite/objc.dg/method-1.m
index 194c64f..bd23493 100644
--- a/gcc/testsuite/objc.dg/method-1.m
+++ b/gcc/testsuite/objc.dg/method-1.m
@@ -1,5 +1,6 @@
/* Tests of duplication. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface class1
- (int) meth1; /* { dg-message "previous declaration" } */
diff --git a/gcc/testsuite/objc.dg/method-12.m b/gcc/testsuite/objc.dg/method-12.m
index 411caac..b69a84f 100644
--- a/gcc/testsuite/objc.dg/method-12.m
+++ b/gcc/testsuite/objc.dg/method-12.m
@@ -1,5 +1,6 @@
/* Contributed by Igor Seleznev <selez@mail.ru>. */
/* This used to be broken. */
+/* { dg-additional-options "-Wno-objc-root-class" } */
#include <objc/objc.h>
diff --git a/gcc/testsuite/objc.dg/method-13.m b/gcc/testsuite/objc.dg/method-13.m
index 592038b..3e0fde5 100644
--- a/gcc/testsuite/objc.dg/method-13.m
+++ b/gcc/testsuite/objc.dg/method-13.m
@@ -4,6 +4,7 @@
/* 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"
diff --git a/gcc/testsuite/objc.dg/method-14.m b/gcc/testsuite/objc.dg/method-14.m
index 9698225..bc3ee12 100644
--- a/gcc/testsuite/objc.dg/method-14.m
+++ b/gcc/testsuite/objc.dg/method-14.m
@@ -2,6 +2,7 @@
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;
diff --git a/gcc/testsuite/objc.dg/missing-proto-3.m b/gcc/testsuite/objc.dg/missing-proto-3.m
index 05e1a25..77aa3a3 100644
--- a/gcc/testsuite/objc.dg/missing-proto-3.m
+++ b/gcc/testsuite/objc.dg/missing-proto-3.m
@@ -2,7 +2,8 @@
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
diff --git a/gcc/testsuite/objc.dg/next-runtime-1.m b/gcc/testsuite/objc.dg/next-runtime-1.m
index c76b616..2ce798b 100644
--- a/gcc/testsuite/objc.dg/next-runtime-1.m
+++ b/gcc/testsuite/objc.dg/next-runtime-1.m
@@ -7,6 +7,7 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/objc-foreach-1.m b/gcc/testsuite/objc.dg/objc-foreach-1.m
index 81f5dae..e4c958c 100644
--- a/gcc/testsuite/objc.dg/objc-foreach-1.m
+++ b/gcc/testsuite/objc.dg/objc-foreach-1.m
@@ -1,5 +1,6 @@
/* Syntax check for the new foreach statement. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_class *Class;
diff --git a/gcc/testsuite/objc.dg/objc-foreach-2.m b/gcc/testsuite/objc.dg/objc-foreach-2.m
index a01f004..0f79089 100644
--- a/gcc/testsuite/objc.dg/objc-foreach-2.m
+++ b/gcc/testsuite/objc.dg/objc-foreach-2.m
@@ -1,5 +1,6 @@
/* Syntax check for the new foreach statement. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct objc_class *Class;
diff --git a/gcc/testsuite/objc.dg/objc-foreach-3.m b/gcc/testsuite/objc.dg/objc-foreach-3.m
index 922db39..b551ae3 100644
--- a/gcc/testsuite/objc.dg/objc-foreach-3.m
+++ b/gcc/testsuite/objc.dg/objc-foreach-3.m
@@ -1,6 +1,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/objc-nofilename-1.m b/gcc/testsuite/objc.dg/objc-nofilename-1.m
index 21e0c53..3ddaa64 100644
--- a/gcc/testsuite/objc.dg/objc-nofilename-1.m
+++ b/gcc/testsuite/objc.dg/objc-nofilename-1.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/param-1.m b/gcc/testsuite/objc.dg/param-1.m
index 9dbf6e3..8e77811 100644
--- a/gcc/testsuite/objc.dg/param-1.m
+++ b/gcc/testsuite/objc.dg/param-1.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/pch/pch.exp b/gcc/testsuite/objc.dg/pch/pch.exp
index 2da3d96..54c3e42 100644
--- a/gcc/testsuite/objc.dg/pch/pch.exp
+++ b/gcc/testsuite/objc.dg/pch/pch.exp
@@ -41,7 +41,7 @@ foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.m]] {
# 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*" ] {
@@ -52,7 +52,7 @@ 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"
}
}
diff --git a/gcc/testsuite/objc.dg/plugin/diagnostic-test-expressions-1.m b/gcc/testsuite/objc.dg/plugin/diagnostic-test-expressions-1.m
index 23a9302..7070b37 100644
--- a/gcc/testsuite/objc.dg/plugin/diagnostic-test-expressions-1.m
+++ b/gcc/testsuite/objc.dg/plugin/diagnostic-test-expressions-1.m
@@ -1,5 +1,5 @@
/* { 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
diff --git a/gcc/testsuite/objc.dg/pr23709.m b/gcc/testsuite/objc.dg/pr23709.m
index 7ff9b60..2bdcca5 100644
--- a/gcc/testsuite/objc.dg/pr23709.m
+++ b/gcc/testsuite/objc.dg/pr23709.m
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface A
+(void)method: (int)parameter {} /* { dg-error "expected" } */
diff --git a/gcc/testsuite/objc.dg/private-1.m b/gcc/testsuite/objc.dg/private-1.m
index 7540fc5..5bd29e5 100644
--- a/gcc/testsuite/objc.dg/private-1.m
+++ b/gcc/testsuite/objc.dg/private-1.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/private-2.m b/gcc/testsuite/objc.dg/private-2.m
index eff376a..d0646f5 100644
--- a/gcc/testsuite/objc.dg/private-2.m
+++ b/gcc/testsuite/objc.dg/private-2.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/property/property.exp b/gcc/testsuite/objc.dg/property/property.exp
index 47ffcdf..1c203db 100644
--- a/gcc/testsuite/objc.dg/property/property.exp
+++ b/gcc/testsuite/objc.dg/property/property.exp
@@ -31,12 +31,12 @@ dg-init
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.
diff --git a/gcc/testsuite/objc.dg/proto-hier-1.m b/gcc/testsuite/objc.dg/proto-hier-1.m
index 0f409fc..648a4d4 100644
--- a/gcc/testsuite/objc.dg/proto-hier-1.m
+++ b/gcc/testsuite/objc.dg/proto-hier-1.m
@@ -1,6 +1,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/proto-hier-2.m b/gcc/testsuite/objc.dg/proto-hier-2.m
index 819cf4a..6b3f803 100644
--- a/gcc/testsuite/objc.dg/proto-hier-2.m
+++ b/gcc/testsuite/objc.dg/proto-hier-2.m
@@ -1,6 +1,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/proto-lossage-1.m b/gcc/testsuite/objc.dg/proto-lossage-1.m
index 2f7eb98..4564a94 100644
--- a/gcc/testsuite/objc.dg/proto-lossage-1.m
+++ b/gcc/testsuite/objc.dg/proto-lossage-1.m
@@ -2,6 +2,7 @@
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;
diff --git a/gcc/testsuite/objc.dg/proto-lossage-5.m b/gcc/testsuite/objc.dg/proto-lossage-5.m
index 35c0956..a18b357 100644
--- a/gcc/testsuite/objc.dg/proto-lossage-5.m
+++ b/gcc/testsuite/objc.dg/proto-lossage-5.m
@@ -1,5 +1,6 @@
/* Do not lose references to forward-declared protocols. */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@class MyBaseClass;
@class MyClassThatFails;
@protocol _MyProtocol;
diff --git a/gcc/testsuite/objc.dg/proto-qual-1.m b/gcc/testsuite/objc.dg/proto-qual-1.m
index 40eb0f9..6e90872 100644
--- a/gcc/testsuite/objc.dg/proto-qual-1.m
+++ b/gcc/testsuite/objc.dg/proto-qual-1.m
@@ -3,6 +3,7 @@
/* { 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>
diff --git a/gcc/testsuite/objc.dg/protocol-inheritance-1.m b/gcc/testsuite/objc.dg/protocol-inheritance-1.m
index 5241b29..5367a98 100644
--- a/gcc/testsuite/objc.dg/protocol-inheritance-1.m
+++ b/gcc/testsuite/objc.dg/protocol-inheritance-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/protocol-inheritance-2.m b/gcc/testsuite/objc.dg/protocol-inheritance-2.m
index 74c9174..9776a40 100644
--- a/gcc/testsuite/objc.dg/protocol-inheritance-2.m
+++ b/gcc/testsuite/objc.dg/protocol-inheritance-2.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/protocol-optional-1.m b/gcc/testsuite/objc.dg/protocol-optional-1.m
index bc4a3d0..29fe72e 100644
--- a/gcc/testsuite/objc.dg/protocol-optional-1.m
+++ b/gcc/testsuite/objc.dg/protocol-optional-1.m
@@ -1,5 +1,6 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/selector-1.m b/gcc/testsuite/objc.dg/selector-1.m
index f0781b6..5ff15a2 100644
--- a/gcc/testsuite/objc.dg/selector-1.m
+++ b/gcc/testsuite/objc.dg/selector-1.m
@@ -3,6 +3,7 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/selector-2.m b/gcc/testsuite/objc.dg/selector-2.m
index 6cad2ff..5042104 100644
--- a/gcc/testsuite/objc.dg/selector-2.m
+++ b/gcc/testsuite/objc.dg/selector-2.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/selector-3.m b/gcc/testsuite/objc.dg/selector-3.m
index c0c5f3d..94838cd3 100644
--- a/gcc/testsuite/objc.dg/selector-3.m
+++ b/gcc/testsuite/objc.dg/selector-3.m
@@ -3,6 +3,7 @@
/* { 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;
diff --git a/gcc/testsuite/objc.dg/selector-4.m b/gcc/testsuite/objc.dg/selector-4.m
index d34f8c8..2a4947e 100644
--- a/gcc/testsuite/objc.dg/selector-4.m
+++ b/gcc/testsuite/objc.dg/selector-4.m
@@ -3,6 +3,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/shadow-1.m b/gcc/testsuite/objc.dg/shadow-1.m
index 739a0d0..d18fd6e 100644
--- a/gcc/testsuite/objc.dg/shadow-1.m
+++ b/gcc/testsuite/objc.dg/shadow-1.m
@@ -2,6 +2,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/shadow-2.m b/gcc/testsuite/objc.dg/shadow-2.m
index 16261b9..26447fe 100644
--- a/gcc/testsuite/objc.dg/shadow-2.m
+++ b/gcc/testsuite/objc.dg/shadow-2.m
@@ -2,6 +2,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/special/load-category-1.m b/gcc/testsuite/objc.dg/special/load-category-1.m
index cb22143..b72d070 100644
--- a/gcc/testsuite/objc.dg/special/load-category-1.m
+++ b/gcc/testsuite/objc.dg/special/load-category-1.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/special/load-category-2.m b/gcc/testsuite/objc.dg/special/load-category-2.m
index 7dc74595..2706351 100644
--- a/gcc/testsuite/objc.dg/special/load-category-2.m
+++ b/gcc/testsuite/objc.dg/special/load-category-2.m
@@ -1,6 +1,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/special/load-category-3.m b/gcc/testsuite/objc.dg/special/load-category-3.m
index b89d8f1..215e463 100644
--- a/gcc/testsuite/objc.dg/special/load-category-3.m
+++ b/gcc/testsuite/objc.dg/special/load-category-3.m
@@ -1,6 +1,7 @@
/* 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
diff --git a/gcc/testsuite/objc.dg/special/special.exp b/gcc/testsuite/objc.dg/special/special.exp
index d770e2a..f561d38 100644
--- a/gcc/testsuite/objc.dg/special/special.exp
+++ b/gcc/testsuite/objc.dg/special/special.exp
@@ -39,6 +39,7 @@ dg-init
# 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"
@@ -50,6 +51,7 @@ if ![string match "" $lines] then {
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"
@@ -66,6 +68,7 @@ if ![string match "" $lines] then {
# 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"
@@ -77,6 +80,7 @@ if ![string match "" $lines] then {
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"
@@ -93,6 +97,7 @@ if ![string match "" $lines] then {
# 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"
@@ -104,6 +109,7 @@ if ![string match "" $lines] then {
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"
@@ -120,6 +126,7 @@ if ![string match "" $lines] then {
# 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"
@@ -131,6 +138,7 @@ if ![string match "" $lines] then {
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"
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
index a32024d..cb5812e 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
@@ -1,4 +1,5 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
index 7b434b4..a8e422d 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
@@ -1,6 +1,7 @@
/* 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"
diff --git a/gcc/testsuite/objc.dg/stabs-1.m b/gcc/testsuite/objc.dg/stabs-1.m
index 452993e..b97e4d6 100644
--- a/gcc/testsuite/objc.dg/stabs-1.m
+++ b/gcc/testsuite/objc.dg/stabs-1.m
@@ -3,6 +3,7 @@
/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs" } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface MyClass
+ newWithArg: arg;
diff --git a/gcc/testsuite/objc.dg/strings/strings.exp b/gcc/testsuite/objc.dg/strings/strings.exp
index 41da5cb..6042d3c 100644
--- a/gcc/testsuite/objc.dg/strings/strings.exp
+++ b/gcc/testsuite/objc.dg/strings/strings.exp
@@ -35,11 +35,11 @@ dg-init
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.
diff --git a/gcc/testsuite/objc.dg/stubify-1.m b/gcc/testsuite/objc.dg/stubify-1.m
index 641595c..4043492 100644
--- a/gcc/testsuite/objc.dg/stubify-1.m
+++ b/gcc/testsuite/objc.dg/stubify-1.m
@@ -5,6 +5,7 @@
/* { 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 ;
diff --git a/gcc/testsuite/objc.dg/stubify-2.m b/gcc/testsuite/objc.dg/stubify-2.m
index 904ac44..3e9097e 100644
--- a/gcc/testsuite/objc.dg/stubify-2.m
+++ b/gcc/testsuite/objc.dg/stubify-2.m
@@ -5,6 +5,7 @@
/* { 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 ;
diff --git a/gcc/testsuite/objc.dg/super-class-2.m b/gcc/testsuite/objc.dg/super-class-2.m
index 144ea81..63792fd 100644
--- a/gcc/testsuite/objc.dg/super-class-2.m
+++ b/gcc/testsuite/objc.dg/super-class-2.m
@@ -1,6 +1,7 @@
/* 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;
diff --git a/gcc/testsuite/objc.dg/super-dealloc-1.m b/gcc/testsuite/objc.dg/super-dealloc-1.m
index 0ab177b..035de05 100644
--- a/gcc/testsuite/objc.dg/super-dealloc-1.m
+++ b/gcc/testsuite/objc.dg/super-dealloc-1.m
@@ -2,6 +2,7 @@
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
void *isa;
diff --git a/gcc/testsuite/objc.dg/super-dealloc-2.m b/gcc/testsuite/objc.dg/super-dealloc-2.m
index 80dcf49..5d588c5 100644
--- a/gcc/testsuite/objc.dg/super-dealloc-2.m
+++ b/gcc/testsuite/objc.dg/super-dealloc-2.m
@@ -2,6 +2,7 @@
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface Foo {
void *isa;
diff --git a/gcc/testsuite/objc.dg/sync-3.m b/gcc/testsuite/objc.dg/sync-3.m
index 5cee890..6ef72a1 100644
--- a/gcc/testsuite/objc.dg/sync-3.m
+++ b/gcc/testsuite/objc.dg/sync-3.m
@@ -1,6 +1,7 @@
/* 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. */
diff --git a/gcc/testsuite/objc.dg/threedotthree-abi-1.m b/gcc/testsuite/objc.dg/threedotthree-abi-1.m
index 53154d3..8c22850 100644
--- a/gcc/testsuite/objc.dg/threedotthree-abi-1.m
+++ b/gcc/testsuite/objc.dg/threedotthree-abi-1.m
@@ -3,6 +3,7 @@
/* { 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>
diff --git a/gcc/testsuite/objc.dg/torture/dg-torture.exp b/gcc/testsuite/objc.dg/torture/dg-torture.exp
index 28c2359..11f50fc 100644
--- a/gcc/testsuite/objc.dg/torture/dg-torture.exp
+++ b/gcc/testsuite/objc.dg/torture/dg-torture.exp
@@ -7,11 +7,11 @@ dg-init
# 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
diff --git a/gcc/testsuite/objc.dg/torture/strings/strings.exp b/gcc/testsuite/objc.dg/torture/strings/strings.exp
index 64e53c6..3e2b3b0 100644
--- a/gcc/testsuite/objc.dg/torture/strings/strings.exp
+++ b/gcc/testsuite/objc.dg/torture/strings/strings.exp
@@ -24,11 +24,11 @@ dg-init
# 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
diff --git a/gcc/testsuite/objc.dg/try-catch-11.m b/gcc/testsuite/objc.dg/try-catch-11.m
index e08f321..c792c83 100644
--- a/gcc/testsuite/objc.dg/try-catch-11.m
+++ b/gcc/testsuite/objc.dg/try-catch-11.m
@@ -4,6 +4,7 @@
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef volatile int IOSharedLockData;
diff --git a/gcc/testsuite/objc.dg/try-catch-12.m b/gcc/testsuite/objc.dg/try-catch-12.m
index ce26b32..6c9afc2 100644
--- a/gcc/testsuite/objc.dg/try-catch-12.m
+++ b/gcc/testsuite/objc.dg/try-catch-12.m
@@ -4,6 +4,7 @@
/* { dg-options "-fobjc-exceptions" } */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
@interface TestMyTests
- (void) testSpoon;
diff --git a/gcc/testsuite/objc.dg/type-size-2.m b/gcc/testsuite/objc.dg/type-size-2.m
index d02a8af..64444cfe 100644
--- a/gcc/testsuite/objc.dg/type-size-2.m
+++ b/gcc/testsuite/objc.dg/type-size-2.m
@@ -4,6 +4,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/type-size-3.m b/gcc/testsuite/objc.dg/type-size-3.m
index bc66b0b..3f65516 100644
--- a/gcc/testsuite/objc.dg/type-size-3.m
+++ b/gcc/testsuite/objc.dg/type-size-3.m
@@ -1,6 +1,7 @@
/* 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
{
diff --git a/gcc/testsuite/objc.dg/type-size-4.m b/gcc/testsuite/objc.dg/type-size-4.m
index 7e26da3..f10ed5b 100644
--- a/gcc/testsuite/objc.dg/type-size-4.m
+++ b/gcc/testsuite/objc.dg/type-size-4.m
@@ -2,6 +2,7 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
/* PR objc/47832 */
/* { dg-do compile } */
+/* { dg-additional-options "-Wno-objc-root-class" } */
typedef struct
{
diff --git a/gcc/testsuite/objc.dg/type-size-5.m b/gcc/testsuite/objc.dg/type-size-5.m
index d89af32..e1b11f7 100644
--- a/gcc/testsuite/objc.dg/type-size-5.m
+++ b/gcc/testsuite/objc.dg/type-size-5.m
@@ -1,6 +1,7 @@
/* 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
{
diff --git a/gcc/testsuite/objc.dg/undeclared-selector.m b/gcc/testsuite/objc.dg/undeclared-selector.m
index 1cfc6c8..389b032 100644
--- a/gcc/testsuite/objc.dg/undeclared-selector.m
+++ b/gcc/testsuite/objc.dg/undeclared-selector.m
@@ -2,6 +2,7 @@
/* 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>
diff --git a/gcc/testsuite/objc.dg/volatile-1.m b/gcc/testsuite/objc.dg/volatile-1.m
index 8b5381a..a713631 100644
--- a/gcc/testsuite/objc.dg/volatile-1.m
+++ b/gcc/testsuite/objc.dg/volatile-1.m
@@ -1,7 +1,8 @@
/* 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;