From: Iain Sandoe Date: Sun, 25 Oct 2020 09:54:21 +0000 (+0000) Subject: Objective-C [3/3] : Implement Wobjc-root-class [PR77404]. X-Git-Tag: basepoints/gcc-12~3286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64f191b152cb1df0e108a91880cb415e413bad56;p=thirdparty%2Fgcc.git Objective-C [3/3] : Implement Wobjc-root-class [PR77404]. Add Wno-objc-root-class where needed to the objective-c++ tests. gcc/testsuite/ChangeLog: PR objc/77404 * obj-c++.dg/attributes/class-attribute-1.mm: Add Wno-objc-root-class. * obj-c++.dg/attributes/class-attribute-2.mm: Likewise. * obj-c++.dg/attributes/class-attribute-3.mm: Likewise. * obj-c++.dg/attributes/method-deprecated-1.mm: Likewise. * obj-c++.dg/attributes/method-deprecated-2.mm: Likewise. * obj-c++.dg/attributes/method-deprecated-3.mm: Likewise. * obj-c++.dg/attributes/method-format-1.mm: Likewise. * obj-c++.dg/attributes/method-nonnull-1.mm: Likewise. * obj-c++.dg/attributes/method-noreturn-1.mm: Likewise. * obj-c++.dg/attributes/method-sentinel-1.mm: Likewise. * obj-c++.dg/attributes/nsobject-01.mm: Likewise. * obj-c++.dg/attributes/parameter-attribute-1.mm: Likewise. * obj-c++.dg/attributes/parameter-attribute-2.mm: Likewise. * obj-c++.dg/attributes/proto-attribute-1.mm: Likewise. * obj-c++.dg/attributes/proto-attribute-3.mm: Likewise. * obj-c++.dg/attributes/proto-attribute-4.mm: Likewise. * obj-c++.dg/attributes/unused-parameter-1.mm: Likewise. * obj-c++.dg/bad-receiver-type.mm: Likewise. * obj-c++.dg/bitfield-3.mm: Likewise. * obj-c++.dg/bitfield-5.mm: Likewise. * obj-c++.dg/class-extension-1.mm: Likewise. * obj-c++.dg/class-extension-2.mm: Likewise. * obj-c++.dg/class-extension-3.mm: Likewise. * obj-c++.dg/class-extension-4.mm: Likewise. * obj-c++.dg/class-protocol-1.mm: Likewise. * obj-c++.dg/comp-types-1.mm: Likewise. * obj-c++.dg/comp-types-10.mm: Likewise. * obj-c++.dg/comp-types-2.mm: Likewise. * obj-c++.dg/comp-types-3.mm: Likewise. * obj-c++.dg/comp-types-5.mm: Likewise. * obj-c++.dg/comp-types-6.mm: Likewise. * obj-c++.dg/comp-types-7.mm: Likewise. * obj-c++.dg/comp-types-8.mm: Likewise. * obj-c++.dg/demangle-2.mm: Likewise. * obj-c++.dg/demangle-3.mm: Likewise. * obj-c++.dg/duplicate-class-1.mm: Likewise. * obj-c++.dg/encode-1-next.mm: Likewise. * obj-c++.dg/encode-1.mm: Likewise. * obj-c++.dg/enhanced-proto-2.mm: Likewise. * obj-c++.dg/exceptions-1.mm: Likewise. * obj-c++.dg/exceptions-3.mm: Likewise. * obj-c++.dg/exceptions-4.mm: Likewise. * obj-c++.dg/exceptions-5.mm: Likewise. * obj-c++.dg/extern-c-1.mm: Likewise. * obj-c++.dg/fobjc-std-1.mm: Likewise. * obj-c++.dg/gnu-api-2-class-meta.mm: Likewise. * obj-c++.dg/gnu-api-2-class.mm: Likewise. * obj-c++.dg/gnu-api-2-ivar.mm: Likewise. * obj-c++.dg/gnu-api-2-method.mm: Likewise. * obj-c++.dg/gnu-api-2-objc.mm: Likewise. * obj-c++.dg/gnu-api-2-objc_msg_lookup.mm: Likewise. * obj-c++.dg/gnu-api-2-object.mm: Likewise. * obj-c++.dg/gnu-api-2-property.mm: Likewise. * obj-c++.dg/gnu-api-2-protocol.mm: Likewise. * obj-c++.dg/gnu-api-2-resolve-method.mm: Likewise. * obj-c++.dg/gnu-api-2-sel.mm: Likewise. * obj-c++.dg/invalid-method-2.mm: Likewise. * obj-c++.dg/ivar-invalid-type-1.mm: Likewise. * obj-c++.dg/ivar-problem-1.mm: Likewise. * obj-c++.dg/lto/lto.exp: Likewise. * obj-c++.dg/lto/trivial-1_0.mm: Likewise. * obj-c++.dg/method-1.mm: Likewise. * obj-c++.dg/method-12.mm: Likewise. * obj-c++.dg/method-18.mm: Likewise. * obj-c++.dg/method-19.mm: Likewise. * obj-c++.dg/method-20.mm: Likewise. * obj-c++.dg/method-3.mm: Likewise. * obj-c++.dg/method-4.mm: Likewise. * obj-c++.dg/method-5.mm: Likewise. * obj-c++.dg/method-8.mm: Likewise. * obj-c++.dg/method-9.mm: Likewise. * obj-c++.dg/method-namespace-1.mm: Likewise. * obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: Likewise. * obj-c++.dg/pr23709.mm: Likewise. * obj-c++.dg/pragma-2.mm: Likewise. * obj-c++.dg/private-1.mm: Likewise. * obj-c++.dg/private-2.mm: Likewise. * obj-c++.dg/property/property.exp: Likewise. * obj-c++.dg/proto-lossage-1.mm: Likewise. * obj-c++.dg/proto-lossage-5.mm: Likewise. * obj-c++.dg/proto-qual-1.mm: Likewise. * obj-c++.dg/protocol-inheritance-1.mm: Likewise. * obj-c++.dg/protocol-inheritance-2.mm: Likewise. * obj-c++.dg/protocol-optional-1.mm: Likewise. * obj-c++.dg/selector-1.mm: Likewise. * obj-c++.dg/selector-2.mm: Likewise. * obj-c++.dg/selector-3.mm: Likewise. * obj-c++.dg/selector-4.mm: Likewise. * obj-c++.dg/strings/strings.exp: Likewise. * obj-c++.dg/stubify-1.mm: Likewise. * obj-c++.dg/stubify-2.mm: Likewise. * obj-c++.dg/super-dealloc-1.mm: Likewise. * obj-c++.dg/super-dealloc-2.mm: Likewise. * obj-c++.dg/sync-3.mm: Likewise. * obj-c++.dg/syntax-error-2.mm: Likewise. * obj-c++.dg/syntax-error-4.mm: Likewise. * obj-c++.dg/syntax-error-7.mm: Likewise. * obj-c++.dg/syntax-error-9.mm: Likewise. * obj-c++.dg/template-4.mm: Likewise. * obj-c++.dg/template-7.mm: Likewise. * obj-c++.dg/template-8.mm: Likewise. * obj-c++.dg/threedotthree-abi-1.mm: Likewise. * obj-c++.dg/torture/dg-torture.exp: Likewise. * obj-c++.dg/torture/strings/strings.exp: Likewise. * obj-c++.dg/try-catch-12.mm: Likewise. * obj-c++.dg/try-catch-13.mm: Likewise. --- diff --git a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm index f078339b8670..7eafdbc926eb 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ /* Test deprecate attribute with an @interface declaration. */ diff --git a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-2.mm b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-2.mm index 35015c0370a8..629ba864b94b 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-2.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-2.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-3.mm b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-3.mm index f96500de4dc1..3b7c8c384812 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-3.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-3.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/attributes/method-deprecated-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-1.mm index 8343856a5c6f..68e8373920da 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-2.mm b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-2.mm index 1e5d87f3e632..8fb0e1510d00 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-2.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-2.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-3.mm b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-3.mm index 5c715a20b683..efa2d349557b 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-3.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-deprecated-3.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-format-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-format-1.mm index 9ff34f92fb17..d3bb997b2aaf 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-format-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-format-1.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm index 83f918c5a3fb..af48787d7651 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-nonnull-1.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , May 2011. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm index a83048bb7ed7..413a0be4b2bd 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm index 2b8e6fd259de..ece7a9f9caaf 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , October 2010. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/nsobject-01.mm b/gcc/testsuite/obj-c++.dg/attributes/nsobject-01.mm index 498fbc7e8fd5..3af785b9aef1 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/nsobject-01.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/nsobject-01.mm @@ -1,5 +1,5 @@ /* Test handling of the NSObject attribute. */ -/* { dg-additional-options "-fsyntax-only " } */ +/* { dg-additional-options "-fsyntax-only -Wno-objc-root-class" } */ typedef struct AnObj * __attribute__ ((NSObject)) AnObjRef; typedef struct AnObj * __attribute__ ((__NSObject__)) AnotherObjRef; diff --git a/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-1.mm b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-1.mm index a4ba25943ca9..b4556ba0788c 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-1.mm @@ -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 diff --git a/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm index 3908faf99d92..9d69e4209c8b 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm @@ -1,5 +1,6 @@ /* Test that we get warnings for unrecognized attributes. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-1.mm b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-1.mm index a852a7a6c2fd..03726dc7bed7 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-1.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm index fc5251eeea1d..263f92757b0d 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm @@ -1,7 +1,7 @@ /* Contributed by Nicola Pero , November 2010. */ /* { dg-do compile } */ /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ - +/* { dg-additional-options "-Wno-objc-root-class" } */ /* Test deprecate attribute with normal @protocol declarations. */ diff --git a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-4.mm b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-4.mm index d2e5f28a1b4a..665e13da643b 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-4.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-4.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/attributes/unused-parameter-1.mm b/gcc/testsuite/obj-c++.dg/attributes/unused-parameter-1.mm index 8fbb11e20142..c56a7f7d68c0 100644 --- a/gcc/testsuite/obj-c++.dg/attributes/unused-parameter-1.mm +++ b/gcc/testsuite/obj-c++.dg/attributes/unused-parameter-1.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm b/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm index 1d6699f99c58..9c00a068168f 100644 --- a/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm +++ b/gcc/testsuite/obj-c++.dg/bad-receiver-type.mm @@ -1,5 +1,6 @@ // { dg-do compile } // { dg-options "" } +// { dg-additional-options "-Wno-objc-root-class" } @interface A diff --git a/gcc/testsuite/obj-c++.dg/bitfield-3.mm b/gcc/testsuite/obj-c++.dg/bitfield-3.mm index d81976ab6244..c4ed984ef52b 100644 --- a/gcc/testsuite/obj-c++.dg/bitfield-3.mm +++ b/gcc/testsuite/obj-c++.dg/bitfield-3.mm @@ -4,6 +4,7 @@ /* { dg-do run { target *-*-darwin* } } */ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-options "-fsigned-char" } */ +// { dg-additional-options "-Wno-objc-root-class" } typedef struct objc_object { struct objc_class *class_pointer; } *id; diff --git a/gcc/testsuite/obj-c++.dg/bitfield-5.mm b/gcc/testsuite/obj-c++.dg/bitfield-5.mm index 3b0065d7f618..d86c9b135d2d 100644 --- a/gcc/testsuite/obj-c++.dg/bitfield-5.mm +++ b/gcc/testsuite/obj-c++.dg/bitfield-5.mm @@ -3,6 +3,7 @@ (@interface vs. @implementation) checks take the bitfield width into account. */ /* Author: Ziemowit Laski */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface Base { int i; diff --git a/gcc/testsuite/obj-c++.dg/class-extension-1.mm b/gcc/testsuite/obj-c++.dg/class-extension-1.mm index 5c89a9838cfb..c497c1d938d8 100644 --- a/gcc/testsuite/obj-c++.dg/class-extension-1.mm +++ b/gcc/testsuite/obj-c++.dg/class-extension-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/class-extension-2.mm b/gcc/testsuite/obj-c++.dg/class-extension-2.mm index 7f55b601fb3b..108bc001d0ea 100644 --- a/gcc/testsuite/obj-c++.dg/class-extension-2.mm +++ b/gcc/testsuite/obj-c++.dg/class-extension-2.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , December 2010. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } /* This test tests class extensions and protocols. */ diff --git a/gcc/testsuite/obj-c++.dg/class-extension-3.mm b/gcc/testsuite/obj-c++.dg/class-extension-3.mm index 69e570539698..bed849030d68 100644 --- a/gcc/testsuite/obj-c++.dg/class-extension-3.mm +++ b/gcc/testsuite/obj-c++.dg/class-extension-3.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , December 2010. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } /* This test tests warnings on class extensions. */ diff --git a/gcc/testsuite/obj-c++.dg/class-extension-4.mm b/gcc/testsuite/obj-c++.dg/class-extension-4.mm index 9e19aa70d3bd..2cfbc5dd0e5a 100644 --- a/gcc/testsuite/obj-c++.dg/class-extension-4.mm +++ b/gcc/testsuite/obj-c++.dg/class-extension-4.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/class-protocol-1.mm b/gcc/testsuite/obj-c++.dg/class-protocol-1.mm index 78957cb061ed..3b332643a604 100644 --- a/gcc/testsuite/obj-c++.dg/class-protocol-1.mm +++ b/gcc/testsuite/obj-c++.dg/class-protocol-1.mm @@ -1,6 +1,7 @@ /* Check Class types */ /* Author: David Ayers */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include #include "../objc-obj-c++-shared/runtime.h" diff --git a/gcc/testsuite/obj-c++.dg/comp-types-1.mm b/gcc/testsuite/obj-c++.dg/comp-types-1.mm index 6d4e86e4b2a1..6402abc213b2 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-1.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-1.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface A + new; diff --git a/gcc/testsuite/obj-c++.dg/comp-types-10.mm b/gcc/testsuite/obj-c++.dg/comp-types-10.mm index c7f0cb635c71..fdfd0933b892 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-10.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-10.mm @@ -2,6 +2,7 @@ /* { dg-do compile } */ /* { dg-prune-output ".*internal compiler error.*" } */ /* { dg-options "-O3" } */ +// { dg-additional-options "-Wno-objc-root-class" } @class NSString; @protocol NSObject diff --git a/gcc/testsuite/obj-c++.dg/comp-types-2.mm b/gcc/testsuite/obj-c++.dg/comp-types-2.mm index 07043785a229..87750fd67dfb 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-2.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-2.mm @@ -1,6 +1,7 @@ /* Test various ObjC types assignments and comparisons. */ /* Author: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/comp-types-3.mm b/gcc/testsuite/obj-c++.dg/comp-types-3.mm index 2bea01534a72..d4d0790afcc6 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-3.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-3.mm @@ -1,6 +1,7 @@ /* Test simple ObjC types casts. */ /* Author: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/comp-types-5.mm b/gcc/testsuite/obj-c++.dg/comp-types-5.mm index 99f6772bd42e..2c4fc57f0ac9 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-5.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-5.mm @@ -1,6 +1,7 @@ /* Test errors for assignments and comparisons between ObjC and C++ types. */ /* Author: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/comp-types-6.mm b/gcc/testsuite/obj-c++.dg/comp-types-6.mm index 23b84edd374d..071a7563b892 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-6.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-6.mm @@ -1,6 +1,7 @@ /* Test assignments and comparisons involving `one-off' protocols. */ /* Author: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/comp-types-7.mm b/gcc/testsuite/obj-c++.dg/comp-types-7.mm index e23558114bcd..628635575f55 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-7.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-7.mm @@ -1,6 +1,7 @@ /* Test assignments and comparisons involving category protocols. */ /* Author: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/comp-types-8.mm b/gcc/testsuite/obj-c++.dg/comp-types-8.mm index 6db76bb20f3d..0221164ac851 100644 --- a/gcc/testsuite/obj-c++.dg/comp-types-8.mm +++ b/gcc/testsuite/obj-c++.dg/comp-types-8.mm @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-additional-options "-Wno-return-type" } */ +// { 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/obj-c++.dg/demangle-2.mm b/gcc/testsuite/obj-c++.dg/demangle-2.mm index f28208591372..14c7b3e18f87 100644 --- a/gcc/testsuite/obj-c++.dg/demangle-2.mm +++ b/gcc/testsuite/obj-c++.dg/demangle-2.mm @@ -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 #include diff --git a/gcc/testsuite/obj-c++.dg/demangle-3.mm b/gcc/testsuite/obj-c++.dg/demangle-3.mm index afb83d75bfe3..d8d81784f867 100644 --- a/gcc/testsuite/obj-c++.dg/demangle-3.mm +++ b/gcc/testsuite/obj-c++.dg/demangle-3.mm @@ -1,6 +1,7 @@ /* Test demangling an Objective-C method in error messages. */ /* { dg-do compile } */ /* { dg-additional-options "-Wno-return-type" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/duplicate-class-1.mm b/gcc/testsuite/obj-c++.dg/duplicate-class-1.mm index 3a5e5104faa5..77e52c6893f3 100644 --- a/gcc/testsuite/obj-c++.dg/duplicate-class-1.mm +++ b/gcc/testsuite/obj-c++.dg/duplicate-class-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/encode-1-next.mm b/gcc/testsuite/obj-c++.dg/encode-1-next.mm index 47673f20cb20..854dd728691c 100644 --- a/gcc/testsuite/obj-c++.dg/encode-1-next.mm +++ b/gcc/testsuite/obj-c++.dg/encode-1-next.mm @@ -5,6 +5,7 @@ /* { 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/obj-c++.dg/encode-1.mm b/gcc/testsuite/obj-c++.dg/encode-1.mm index 5f5ba20139ef..6247c648274a 100644 --- a/gcc/testsuite/obj-c++.dg/encode-1.mm +++ b/gcc/testsuite/obj-c++.dg/encode-1.mm @@ -3,6 +3,7 @@ /* { 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/obj-c++.dg/enhanced-proto-2.mm b/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm index 31c2e509b7a1..5964dfb09688 100644 --- a/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm +++ b/gcc/testsuite/obj-c++.dg/enhanced-proto-2.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @protocol MyProto1 @optional diff --git a/gcc/testsuite/obj-c++.dg/exceptions-1.mm b/gcc/testsuite/obj-c++.dg/exceptions-1.mm index 0f3b7e8ae147..75327ef7a9fa 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-1.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-1.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/exceptions-3.mm b/gcc/testsuite/obj-c++.dg/exceptions-3.mm index 622e4ca3b60a..7cf77a7821a3 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-3.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-3.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/exceptions-4.mm b/gcc/testsuite/obj-c++.dg/exceptions-4.mm index 4aa00a6006fb..1391c43b8e5b 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-4.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-4.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/exceptions-5.mm b/gcc/testsuite/obj-c++.dg/exceptions-5.mm index 5aa08f35821e..4547a756c740 100644 --- a/gcc/testsuite/obj-c++.dg/exceptions-5.mm +++ b/gcc/testsuite/obj-c++.dg/exceptions-5.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , 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.mm, but with no name for @catch arguments. */ diff --git a/gcc/testsuite/obj-c++.dg/extern-c-1.mm b/gcc/testsuite/obj-c++.dg/extern-c-1.mm index c5fec6fbe931..8b9147a807e9 100644 --- a/gcc/testsuite/obj-c++.dg/extern-c-1.mm +++ b/gcc/testsuite/obj-c++.dg/extern-c-1.mm @@ -1,5 +1,6 @@ /* Test extern c support inside @implementation */ /* Devang Patel . */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/fobjc-std-1.mm b/gcc/testsuite/obj-c++.dg/fobjc-std-1.mm index 59db95091db5..f7f4a199dc01 100644 --- a/gcc/testsuite/obj-c++.dg/fobjc-std-1.mm +++ b/gcc/testsuite/obj-c++.dg/fobjc-std-1.mm @@ -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 diff --git a/gcc/testsuite/obj-c++.dg/gnu-api-2-class-meta.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-class-meta.mm index bdaef9828ca4..92852c3ecea0 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-class-meta.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-class-meta.mm @@ -21,6 +21,7 @@ /* { 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 "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */ +// { 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/obj-c++.dg/gnu-api-2-class.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-class.mm index ae39026c2d34..f6e3d8d22e03 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-class.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-class.mm @@ -8,6 +8,7 @@ /* { 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 "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */ +// { 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/obj-c++.dg/gnu-api-2-ivar.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-ivar.mm index 1c85d238d60d..991edc7271e6 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-ivar.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-ivar.mm @@ -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/obj-c++.dg/gnu-api-2-method.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-method.mm index 97bf84b6fc40..07c3a22ec32f 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-method.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-method.mm @@ -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/obj-c++.dg/gnu-api-2-objc.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm index 201ab7e7af2f..e68e7a899fc8 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-objc.mm @@ -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/obj-c++.dg/gnu-api-2-objc_msg_lookup.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-objc_msg_lookup.mm index dcbf6d21f14a..1fb56dcac901 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-objc_msg_lookup.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-objc_msg_lookup.mm @@ -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/obj-c++.dg/gnu-api-2-object.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-object.mm index a2702d64707c..4d99053103cc 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-object.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-object.mm @@ -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/obj-c++.dg/gnu-api-2-property.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-property.mm index 953e9bb156bc..601f39fa7e99 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-property.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-property.mm @@ -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/obj-c++.dg/gnu-api-2-protocol.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-protocol.mm index 9a2ceca1353f..21ae06bfd276 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-protocol.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-protocol.mm @@ -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/obj-c++.dg/gnu-api-2-resolve-method.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-resolve-method.mm index f8a54d392c3e..dc311324c08f 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-resolve-method.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-resolve-method.mm @@ -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/obj-c++.dg/gnu-api-2-sel.mm b/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm index ff50058566b4..dd8ff3eeefe2 100644 --- a/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm +++ b/gcc/testsuite/obj-c++.dg/gnu-api-2-sel.mm @@ -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/obj-c++.dg/invalid-method-2.mm b/gcc/testsuite/obj-c++.dg/invalid-method-2.mm index e3a8ed1ff178..8eee0ff64327 100644 --- a/gcc/testsuite/obj-c++.dg/invalid-method-2.mm +++ b/gcc/testsuite/obj-c++.dg/invalid-method-2.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } /* Test that using an invalid type in a method declaration produces a friendly error without a compiler crash. */ diff --git a/gcc/testsuite/obj-c++.dg/ivar-invalid-type-1.mm b/gcc/testsuite/obj-c++.dg/ivar-invalid-type-1.mm index 4c1480a6be99..974e919d639d 100644 --- a/gcc/testsuite/obj-c++.dg/ivar-invalid-type-1.mm +++ b/gcc/testsuite/obj-c++.dg/ivar-invalid-type-1.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include @interface MyRootClass diff --git a/gcc/testsuite/obj-c++.dg/ivar-problem-1.mm b/gcc/testsuite/obj-c++.dg/ivar-problem-1.mm index 4ed5afaf4ef3..1736f9c445a4 100644 --- a/gcc/testsuite/obj-c++.dg/ivar-problem-1.mm +++ b/gcc/testsuite/obj-c++.dg/ivar-problem-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , November 2010. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } /* This test checks what happens if there are 16 instance variables. In that case, the class was not created correctly. In this testcase, diff --git a/gcc/testsuite/obj-c++.dg/lto/lto.exp b/gcc/testsuite/obj-c++.dg/lto/lto.exp index 6ba5f9c48fdf..936872a3bfe8 100644 --- a/gcc/testsuite/obj-c++.dg/lto/lto.exp +++ b/gcc/testsuite/obj-c++.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} \ ] obj-c++_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/obj-c++.dg/lto/trivial-1_0.mm b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm index 55f62f03cfc5..c3620c36025d 100644 --- a/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm +++ b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm @@ -1,5 +1,5 @@ /* { dg-lto-do run } */ -/* { dg-skip-if "Needs OBJC2 ABI" { "*-*-darwin*" && lp64 } } */ + extern "C" { extern int printf (const char *,...) ; extern void abort (void) ; diff --git a/gcc/testsuite/obj-c++.dg/method-1.mm b/gcc/testsuite/obj-c++.dg/method-1.mm index 7317ae2aa87c..5bb851ad5f66 100644 --- a/gcc/testsuite/obj-c++.dg/method-1.mm +++ b/gcc/testsuite/obj-c++.dg/method-1.mm @@ -3,6 +3,7 @@ /* Author: Ziemowit Laski . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-12.mm b/gcc/testsuite/obj-c++.dg/method-12.mm index 454614451787..d3145abadb30 100644 --- a/gcc/testsuite/obj-c++.dg/method-12.mm +++ b/gcc/testsuite/obj-c++.dg/method-12.mm @@ -3,6 +3,7 @@ /* { dg-options "-Wstrict-selector-match" } */ /* { dg-do compile } */ /* { dg-skip-if "Object interface removed" { *-*-darwin[1-2]* && { lp64 } } { "-fnext-runtime" } { "" } } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-18.mm b/gcc/testsuite/obj-c++.dg/method-18.mm index 411caac111ad..c753f33279d3 100644 --- a/gcc/testsuite/obj-c++.dg/method-18.mm +++ b/gcc/testsuite/obj-c++.dg/method-18.mm @@ -1,5 +1,6 @@ /* Contributed by Igor Seleznev . */ /* This used to be broken. */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-19.mm b/gcc/testsuite/obj-c++.dg/method-19.mm index 225becae0f15..a3b977ef356c 100644 --- a/gcc/testsuite/obj-c++.dg/method-19.mm +++ b/gcc/testsuite/obj-c++.dg/method-19.mm @@ -4,6 +4,7 @@ /* Author: Ziemowit Laski . */ /* { dg-do run } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +// { dg-additional-options "-Wno-objc-root-class" } #include #include "../objc-obj-c++-shared/runtime.h" diff --git a/gcc/testsuite/obj-c++.dg/method-20.mm b/gcc/testsuite/obj-c++.dg/method-20.mm index 96982254aa9f..a7fe41d0905c 100644 --- a/gcc/testsuite/obj-c++.dg/method-20.mm +++ b/gcc/testsuite/obj-c++.dg/method-20.mm @@ -2,6 +2,7 @@ used as method selectors. */ /* Author: Ziemowit Laski . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface Foo - (void)insertNewButtonImage:(Foo *)newButtonImage in:(Foo *)buttonCell; diff --git a/gcc/testsuite/obj-c++.dg/method-3.mm b/gcc/testsuite/obj-c++.dg/method-3.mm index 9dab8c5b3324..17b0c99fb960 100644 --- a/gcc/testsuite/obj-c++.dg/method-3.mm +++ b/gcc/testsuite/obj-c++.dg/method-3.mm @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-Wno-strict-selector-match" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-4.mm b/gcc/testsuite/obj-c++.dg/method-4.mm index e94f8f1b7709..1f2f93eb93db 100644 --- a/gcc/testsuite/obj-c++.dg/method-4.mm +++ b/gcc/testsuite/obj-c++.dg/method-4.mm @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-Wstrict-selector-match" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-5.mm b/gcc/testsuite/obj-c++.dg/method-5.mm index 17c841a46612..10364cc38093 100644 --- a/gcc/testsuite/obj-c++.dg/method-5.mm +++ b/gcc/testsuite/obj-c++.dg/method-5.mm @@ -3,6 +3,7 @@ /* { dg-do compile } */ /* { dg-options "-Wno-strict-selector-match" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/method-8.mm b/gcc/testsuite/obj-c++.dg/method-8.mm index cde1bc27469b..9c5c17a96b4f 100644 --- a/gcc/testsuite/obj-c++.dg/method-8.mm +++ b/gcc/testsuite/obj-c++.dg/method-8.mm @@ -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/obj-c++.dg/method-9.mm b/gcc/testsuite/obj-c++.dg/method-9.mm index 787e25d67ffd..bee076e7c98b 100644 --- a/gcc/testsuite/obj-c++.dg/method-9.mm +++ b/gcc/testsuite/obj-c++.dg/method-9.mm @@ -1,6 +1,7 @@ /* Test for lookup of class (factory) methods. */ /* Author: Ziemowit Laski . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface MyBase - (void) rootInstanceMethod; diff --git a/gcc/testsuite/obj-c++.dg/method-namespace-1.mm b/gcc/testsuite/obj-c++.dg/method-namespace-1.mm index 6095f572ccac..86006a73b8d5 100644 --- a/gcc/testsuite/obj-c++.dg/method-namespace-1.mm +++ b/gcc/testsuite/obj-c++.dg/method-namespace-1.mm @@ -1,5 +1,6 @@ /* Test for usage of namespace inside @implementation. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface MyDocument @end diff --git a/gcc/testsuite/obj-c++.dg/plugin/diagnostic-test-expressions-1.mm b/gcc/testsuite/obj-c++.dg/plugin/diagnostic-test-expressions-1.mm index 988b290ce690..128b3bd8fe99 100644 --- a/gcc/testsuite/obj-c++.dg/plugin/diagnostic-test-expressions-1.mm +++ b/gcc/testsuite/obj-c++.dg/plugin/diagnostic-test-expressions-1.mm @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-O -fdiagnostics-show-caret" } */ /* { dg-excess-errors "tree range 0:0-0:0" { target { *-*-darwin* } } } */ +// { dg-additional-options "-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/obj-c++.dg/pr23709.mm b/gcc/testsuite/obj-c++.dg/pr23709.mm index 018b53ac4566..7936956854f9 100644 --- a/gcc/testsuite/obj-c++.dg/pr23709.mm +++ b/gcc/testsuite/obj-c++.dg/pr23709.mm @@ -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/obj-c++.dg/pragma-2.mm b/gcc/testsuite/obj-c++.dg/pragma-2.mm index 14c4d7928a24..09feac7971f3 100644 --- a/gcc/testsuite/obj-c++.dg/pragma-2.mm +++ b/gcc/testsuite/obj-c++.dg/pragma-2.mm @@ -1,5 +1,6 @@ /* It is OK to use #pragma inside @implementation body. This test checks that. */ /* Ziemowit Laski . */ +// { dg-additional-options "-Wno-objc-root-class" } @interface A { diff --git a/gcc/testsuite/obj-c++.dg/private-1.mm b/gcc/testsuite/obj-c++.dg/private-1.mm index 0c25aea5566d..2173b9005304 100644 --- a/gcc/testsuite/obj-c++.dg/private-1.mm +++ b/gcc/testsuite/obj-c++.dg/private-1.mm @@ -1,6 +1,7 @@ /* Test errors for accessing @private and @protected variables. */ /* Based on work by: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include @interface MySuperClass diff --git a/gcc/testsuite/obj-c++.dg/private-2.mm b/gcc/testsuite/obj-c++.dg/private-2.mm index 3e6ff118d23c..93b8a8fd5c5d 100644 --- a/gcc/testsuite/obj-c++.dg/private-2.mm +++ b/gcc/testsuite/obj-c++.dg/private-2.mm @@ -2,6 +2,7 @@ /* Based on work by: Nicola Pero . */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/property/property.exp b/gcc/testsuite/obj-c++.dg/property/property.exp index d18f6100fcf7..31e683c5c000 100644 --- a/gcc/testsuite/obj-c++.dg/property/property.exp +++ b/gcc/testsuite/obj-c++.dg/property/property.exp @@ -31,12 +31,12 @@ dg-init set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]] # Main loop. -dg-runtest $tests "-fgnu-runtime" $DEFAULT_OBJCXXFLAGS +dg-runtest $tests "-fgnu-runtime -Wno-objc-root-class" $DEFAULT_OBJCXXFLAGS # 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_OBJCXXFLAGS + dg-runtest $tests "-fnext-runtime -Wno-objc-root-class" $DEFAULT_OBJCXXFLAGS } # All done. diff --git a/gcc/testsuite/obj-c++.dg/proto-lossage-1.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-1.mm index 2f7eb9861400..82cd05374b2e 100644 --- a/gcc/testsuite/obj-c++.dg/proto-lossage-1.mm +++ b/gcc/testsuite/obj-c++.dg/proto-lossage-1.mm @@ -2,6 +2,7 @@ may be lost, leading to superfluous warnings. */ /* Author: Ziemowit Laski . */ /* { 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/obj-c++.dg/proto-lossage-5.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-5.mm index 35c0956ed8ec..2a30bc2a9af6 100644 --- a/gcc/testsuite/obj-c++.dg/proto-lossage-5.mm +++ b/gcc/testsuite/obj-c++.dg/proto-lossage-5.mm @@ -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/obj-c++.dg/proto-qual-1.mm b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm index 7ef0e9a98ef5..b2350648f229 100644 --- a/gcc/testsuite/obj-c++.dg/proto-qual-1.mm +++ b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm @@ -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 #include diff --git a/gcc/testsuite/obj-c++.dg/protocol-inheritance-1.mm b/gcc/testsuite/obj-c++.dg/protocol-inheritance-1.mm index 5241b29abbd4..c505c0083fa5 100644 --- a/gcc/testsuite/obj-c++.dg/protocol-inheritance-1.mm +++ b/gcc/testsuite/obj-c++.dg/protocol-inheritance-1.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , November 2010. */ /* { dg-do compile } */ /* { dg-options "-Wno-protocol" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/protocol-inheritance-2.mm b/gcc/testsuite/obj-c++.dg/protocol-inheritance-2.mm index 74c9174b5de7..f2bc1cadc181 100644 --- a/gcc/testsuite/obj-c++.dg/protocol-inheritance-2.mm +++ b/gcc/testsuite/obj-c++.dg/protocol-inheritance-2.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , November 2010. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/protocol-optional-1.mm b/gcc/testsuite/obj-c++.dg/protocol-optional-1.mm index bc4a3d07e978..4ecf43629b9f 100644 --- a/gcc/testsuite/obj-c++.dg/protocol-optional-1.mm +++ b/gcc/testsuite/obj-c++.dg/protocol-optional-1.mm @@ -1,5 +1,6 @@ /* Contributed by Nicola Pero , November 2010. */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } #include diff --git a/gcc/testsuite/obj-c++.dg/selector-1.mm b/gcc/testsuite/obj-c++.dg/selector-1.mm index d34f8c89cd6f..b0cdc9cc81b0 100644 --- a/gcc/testsuite/obj-c++.dg/selector-1.mm +++ b/gcc/testsuite/obj-c++.dg/selector-1.mm @@ -3,6 +3,7 @@ /* Author: Ziemowit Laski . */ /* { 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/obj-c++.dg/selector-2.mm b/gcc/testsuite/obj-c++.dg/selector-2.mm index 840ee19fee48..fa9ab4199f2e 100644 --- a/gcc/testsuite/obj-c++.dg/selector-2.mm +++ b/gcc/testsuite/obj-c++.dg/selector-2.mm @@ -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 diff --git a/gcc/testsuite/obj-c++.dg/selector-3.mm b/gcc/testsuite/obj-c++.dg/selector-3.mm index a1321a7b7413..0c9805626ed5 100644 --- a/gcc/testsuite/obj-c++.dg/selector-3.mm +++ b/gcc/testsuite/obj-c++.dg/selector-3.mm @@ -2,6 +2,7 @@ /* This is the "-fgnu-runtime" variant of objc.dg/selector-1.m. */ /* { dg-options "-Wselector -fgnu-runtime" } */ /* { dg-do compile } */ +// { 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/obj-c++.dg/selector-4.mm b/gcc/testsuite/obj-c++.dg/selector-4.mm index 690cc44b698a..b6ddcbe43ebe 100644 --- a/gcc/testsuite/obj-c++.dg/selector-4.mm +++ b/gcc/testsuite/obj-c++.dg/selector-4.mm @@ -3,6 +3,7 @@ /* { dg-options "-Wselector -fnext-runtime" } */ /* { dg-do compile } */ +// { 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/obj-c++.dg/strings/strings.exp b/gcc/testsuite/obj-c++.dg/strings/strings.exp index 1bfb3be7e00d..0243f24f306a 100644 --- a/gcc/testsuite/obj-c++.dg/strings/strings.exp +++ b/gcc/testsuite/obj-c++.dg/strings/strings.exp @@ -34,11 +34,11 @@ dg-init set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]] # Main loop. -dg-runtest $tests "-fgnu-runtime" $DEFAULT_OBJCXXFLAGS +dg-runtest $tests "-fgnu-runtime -Wno-objc-root-class" $DEFAULT_OBJCXXFLAGS # darwin targets can also run code with the NeXT runtime. if [istarget "*-*-darwin*" ] { - dg-runtest $tests "-fnext-runtime" $DEFAULT_OBJCXXFLAGS + dg-runtest $tests "-fnext-runtime -Wno-objc-root-class" $DEFAULT_OBJCXXFLAGS } # All done. diff --git a/gcc/testsuite/obj-c++.dg/stubify-1.mm b/gcc/testsuite/obj-c++.dg/stubify-1.mm index a32e282519cd..21de46333fdb 100644 --- a/gcc/testsuite/obj-c++.dg/stubify-1.mm +++ b/gcc/testsuite/obj-c++.dg/stubify-1.mm @@ -5,6 +5,7 @@ /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ /* { dg-require-effective-target ilp32 } */ /* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -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/obj-c++.dg/stubify-2.mm b/gcc/testsuite/obj-c++.dg/stubify-2.mm index 69fea8def42e..cbc52b1a9e5e 100644 --- a/gcc/testsuite/obj-c++.dg/stubify-2.mm +++ b/gcc/testsuite/obj-c++.dg/stubify-2.mm @@ -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/obj-c++.dg/super-dealloc-1.mm b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm index 0ab177bb73c9..39ddd01f6941 100644 --- a/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm +++ b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm @@ -2,6 +2,7 @@ /* Author: Ziemowit Laski */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface Foo { void *isa; diff --git a/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm b/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm index 80dcf495062d..6dac31c17f4a 100644 --- a/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm +++ b/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm @@ -2,6 +2,7 @@ /* Author: Ziemowit Laski */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface Foo { void *isa; diff --git a/gcc/testsuite/obj-c++.dg/sync-3.mm b/gcc/testsuite/obj-c++.dg/sync-3.mm index 95def43d05db..2949d6a8a135 100644 --- a/gcc/testsuite/obj-c++.dg/sync-3.mm +++ b/gcc/testsuite/obj-c++.dg/sync-3.mm @@ -1,6 +1,7 @@ /* Contributed by Nicola Pero , 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/obj-c++.dg/syntax-error-2.mm b/gcc/testsuite/obj-c++.dg/syntax-error-2.mm index ba8804a89e28..bf4d5ffb4a7a 100644 --- a/gcc/testsuite/obj-c++.dg/syntax-error-2.mm +++ b/gcc/testsuite/obj-c++.dg/syntax-error-2.mm @@ -1,4 +1,5 @@ /* Recover gracefully from a syntax error. */ +// { dg-additional-options "-Wno-objc-root-class" } @implementation Whatever /* { dg-warning "cannot find interface declaration for .Whatever." } */ diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-4.mm b/gcc/testsuite/obj-c++.dg/syntax-error-4.mm index 0df061839b49..97587f984950 100644 --- a/gcc/testsuite/obj-c++.dg/syntax-error-4.mm +++ b/gcc/testsuite/obj-c++.dg/syntax-error-4.mm @@ -1,5 +1,6 @@ /* Yet another stray infinite loop... */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface t { diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-7.mm b/gcc/testsuite/obj-c++.dg/syntax-error-7.mm index 5bdccc7b05f3..c406d8fe769f 100644 --- a/gcc/testsuite/obj-c++.dg/syntax-error-7.mm +++ b/gcc/testsuite/obj-c++.dg/syntax-error-7.mm @@ -1,4 +1,5 @@ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface Foo -(void) someMethod; diff --git a/gcc/testsuite/obj-c++.dg/syntax-error-9.mm b/gcc/testsuite/obj-c++.dg/syntax-error-9.mm index 1876c32dd20d..ad8837c28af8 100644 --- a/gcc/testsuite/obj-c++.dg/syntax-error-9.mm +++ b/gcc/testsuite/obj-c++.dg/syntax-error-9.mm @@ -1,3 +1,4 @@ +// { dg-additional-options "-Wno-objc-root-class" } @implementation SaturnDoc /* { dg-warning "cannot find interface declaration" } */ - read: (void*)aStream ggg /* { dg-error "expected .:. at end of input" } */ /* { dg-error "-:expected ..*. at end of input" "" { target *-*-* } .+1 } */ diff --git a/gcc/testsuite/obj-c++.dg/template-4.mm b/gcc/testsuite/obj-c++.dg/template-4.mm index 5301df5c0e0a..02795e76e287 100644 --- a/gcc/testsuite/obj-c++.dg/template-4.mm +++ b/gcc/testsuite/obj-c++.dg/template-4.mm @@ -4,6 +4,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.mm" } */ +// { dg-additional-options "-Wno-objc-root-class" } #include #include diff --git a/gcc/testsuite/obj-c++.dg/template-7.mm b/gcc/testsuite/obj-c++.dg/template-7.mm index 8621abebaf16..b3697a584a0c 100644 --- a/gcc/testsuite/obj-c++.dg/template-7.mm +++ b/gcc/testsuite/obj-c++.dg/template-7.mm @@ -3,6 +3,7 @@ // Author: Fariborz Jahanian // { dg-do compile } // { dg-options "" } +// { dg-additional-options "-Wno-objc-root-class" } typedef struct objc_class *Class; @interface Object diff --git a/gcc/testsuite/obj-c++.dg/template-8.mm b/gcc/testsuite/obj-c++.dg/template-8.mm index df215b8525d2..1b9f4d16ae97 100644 --- a/gcc/testsuite/obj-c++.dg/template-8.mm +++ b/gcc/testsuite/obj-c++.dg/template-8.mm @@ -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" } #include #include diff --git a/gcc/testsuite/obj-c++.dg/threedotthree-abi-1.mm b/gcc/testsuite/obj-c++.dg/threedotthree-abi-1.mm index c48181049f1f..32f4fd84e887 100644 --- a/gcc/testsuite/obj-c++.dg/threedotthree-abi-1.mm +++ b/gcc/testsuite/obj-c++.dg/threedotthree-abi-1.mm @@ -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 #include diff --git a/gcc/testsuite/obj-c++.dg/torture/dg-torture.exp b/gcc/testsuite/obj-c++.dg/torture/dg-torture.exp index c3d3f8e29fd1..4e4620791e87 100644 --- a/gcc/testsuite/obj-c++.dg/torture/dg-torture.exp +++ b/gcc/testsuite/obj-c++.dg/torture/dg-torture.exp @@ -7,11 +7,11 @@ dg-init # Gather a list of all tests. set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]] -obj-c++-dg-runtest $tests "" "-fgnu-runtime" +obj-c++-dg-runtest $tests "" "-fgnu-runtime -Wno-objc-root-class" # darwin targets can also run code with the NeXT runtime. if [istarget "*-*-darwin*" ] { - obj-c++-dg-runtest $tests "" "-fnext-runtime" + obj-c++-dg-runtest $tests "" "-fnext-runtime -Wno-objc-root-class" } dg-finish diff --git a/gcc/testsuite/obj-c++.dg/torture/strings/strings.exp b/gcc/testsuite/obj-c++.dg/torture/strings/strings.exp index 401bc5856bfc..6181c30b1983 100644 --- a/gcc/testsuite/obj-c++.dg/torture/strings/strings.exp +++ b/gcc/testsuite/obj-c++.dg/torture/strings/strings.exp @@ -24,11 +24,11 @@ dg-init # Gather a list of all tests. set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]] -obj-c++-dg-runtest $tests "" "-fgnu-runtime" +obj-c++-dg-runtest $tests "" "-fgnu-runtime -Wno-objc-root-class" # Darwin targets can also run code with the NeXT runtime. if [istarget "*-*-darwin*" ] { - obj-c++-dg-runtest $tests "" "-fnext-runtime" + obj-c++-dg-runtest $tests "" "-fnext-runtime -Wno-objc-root-class" } dg-finish diff --git a/gcc/testsuite/obj-c++.dg/try-catch-12.mm b/gcc/testsuite/obj-c++.dg/try-catch-12.mm index e08f321e8c79..6a6080557840 100644 --- a/gcc/testsuite/obj-c++.dg/try-catch-12.mm +++ b/gcc/testsuite/obj-c++.dg/try-catch-12.mm @@ -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/obj-c++.dg/try-catch-13.mm b/gcc/testsuite/obj-c++.dg/try-catch-13.mm index 050d81135556..0e6f01b23e97 100644 --- a/gcc/testsuite/obj-c++.dg/try-catch-13.mm +++ b/gcc/testsuite/obj-c++.dg/try-catch-13.mm @@ -4,6 +4,7 @@ /* { dg-options "-fobjc-exceptions" } */ /* { dg-do compile } */ +// { dg-additional-options "-Wno-objc-root-class" } @interface TestMyTests - (void) testSpoon;