From: Iain Sandoe Date: Thu, 12 Nov 2020 13:11:11 +0000 (+0000) Subject: Objective-C [2/3] : Implement Wobjc-root-class [PR77404]. X-Git-Tag: basepoints/gcc-12~3287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d35fbf7f7673b5c72ee61720f1a209d4e798152f;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/testsuite/objc.dg/anon-1.m b/gcc/testsuite/objc.dg/anon-1.m index 5f10f7d60261..5dab3fa142d6 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 3444760bc3d3..93e5d7f40aeb 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 2e1bacb3fa01..f8137ffb4c4b 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 diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-3.m b/gcc/testsuite/objc.dg/attributes/class-attribute-3.m index 6cc5d4e26810..7c3b3b0e0062 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 , 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 8343856a5c6f..68e8373920da 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 , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m b/gcc/testsuite/objc.dg/attributes/method-deprecated-2.m index 1e5d87f3e632..8fb0e1510d00 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 , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m b/gcc/testsuite/objc.dg/attributes/method-deprecated-3.m index 5c715a20b683..efa2d349557b 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 , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/attributes/method-format-1.m b/gcc/testsuite/objc.dg/attributes/method-format-1.m index 9ff34f92fb17..d3bb997b2aaf 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 , October 2010. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m b/gcc/testsuite/objc.dg/attributes/method-nonnull-1.m index fe5f885b2d46..a3bfd9bc3c69 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 , May 2011. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m index a83048bb7ed7..413a0be4b2bd 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 , October 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m b/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m index e2abb1e8a1d5..f89c98121b9d 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 , October 2010. */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include #include diff --git a/gcc/testsuite/objc.dg/attributes/nsobject-01.m b/gcc/testsuite/objc.dg/attributes/nsobject-01.m index 5b5684903910..1f331508a89f 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 e7f6f856f8fa..19e5ade8bcd1 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 , 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 8263df66db97..d6ebaf227f3b 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 diff --git a/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m b/gcc/testsuite/objc.dg/attributes/parameter-attribute-2.m index 99c5a308b8cb..637846d4a089 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 diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-1.m index a852a7a6c2fd..03726dc7bed7 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 diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m index b23b81de20c2..6a73d248ee8f 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 , 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 2be286ecfb70..ad6d0c804b1b 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 , 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 226fd68b3f2a..8d34ebdcc2fe 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 , 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 7e8147a7008d..b28c81e05695 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 896849472a71..6176832ed1c5 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 05049373fa4f..64383f22d99e 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 5c89a9838cfb..9d6658a63993 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 , 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 7f55b601fb3b..293facb189f8 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 , 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 69e570539698..51fe5eef0836 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 , 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 692a0fcbd0a8..5d367d40bd53 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 , 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 59c8f8276159..34680c2ef3a8 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 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/objc.dg/comp-types-7.m b/gcc/testsuite/objc.dg/comp-types-7.m index 526934fbb821..6b796f09b296 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 42b79a9eb0a4..61e79a699766 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 #include diff --git a/gcc/testsuite/objc.dg/duplicate-class-1.m b/gcc/testsuite/objc.dg/duplicate-class-1.m index 30a18ffa5a68..7992ebf978c5 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 , 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 c3d922659aa8..18ee15db446c 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 */ /* { 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 291a41e96a0a..9e9e4925c5ea 100644 --- a/gcc/testsuite/objc.dg/encode-6.m +++ b/gcc/testsuite/objc.dg/encode-6.m @@ -2,6 +2,7 @@ /* Author: Ziemowit Laski */ /* { 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 c196b5151c9d..ca99445df409 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 0f3b7e8ae147..1e861773b966 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 , 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 69a6494e0482..bedaf53ee839 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 , 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 bbdb741f40b5..5d77ffa61d25 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 , 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 55ef0f340e69..31796bc4c5cd 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 , 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 9a15b8af5da9..729f65c5ea61 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 @@ -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 93bc9028463f..ccce557482fb 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 faee73b82234..23656090c3cc 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 dce26fa3e939..1bcb10b6fafb 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 54a879e22c5b..70ea8ace43de 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 3a85b163c913..6c1c76a87a31 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 #include -#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 eade0dcbbfa1..d11dae0e6dc1 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 19ac004e7b16..072d2655bb8b 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 0c4fe4f0c5e1..ea1da8d138f5 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 1b4ce8e47993..e9ec5d7ab940 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 5751f3fd298b..d417225cdfb0 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 3d4d444fe27e..20c4342d2670 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 12c0d8b98e33..0ef4d79f9b35 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 a34d74ce90dd..682adcd716e9 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 a387709908cf..6eaa3dd72a31 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 b71fdfab48cb..bc581bec2f74 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 f1e875f9aaea..60d0d8a11331 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 32cafdf314c3..dc279269d242 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 cb18de957402..0a4bd6390fcd 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 3e7785db86f8..98bf36e17c9e 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 +#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 4a877680549a..0d5bb66ea324 100644 --- a/gcc/testsuite/objc.dg/ivar-problem-1.m +++ b/gcc/testsuite/objc.dg/ivar-problem-1.m @@ -10,6 +10,9 @@ #include #include +#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 34443a442fe0..64d275b44bd1 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 +#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 ff795d08d6a3..1149d735d127 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 +#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 5fc29f90bdcb..df1c8927586e 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 . */ /* { 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 diff --git a/gcc/testsuite/objc.dg/ivar-visibility-1.m b/gcc/testsuite/objc.dg/ivar-visibility-1.m index 5a222591d19a..79d791ec7aba 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 . */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/ivar-visibility-2.m b/gcc/testsuite/objc.dg/ivar-visibility-2.m index eb41c8f4db02..6ddcb5b46652 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 . */ /* { dg-do compile } */ -/* { dg-additional-options "-fivar-visibility=protected" } */ +/* { dg-additional-options "-fivar-visibility=protected -Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/ivar-visibility-3.m b/gcc/testsuite/objc.dg/ivar-visibility-3.m index ecc6f99c7605..64035037a25d 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 . */ /* { dg-do compile } */ -/* { dg-additional-options "-fivar-visibility=private" } */ +/* { dg-additional-options "-fivar-visibility=private -Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/ivar-visibility-4.m b/gcc/testsuite/objc.dg/ivar-visibility-4.m index adfeb449e55b..abd802b5423d 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 . */ /* { dg-do compile } */ -/* { dg-additional-options "-fivar-visibility=public" } */ +/* { dg-additional-options "-fivar-visibility=public -Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/local-decl-1.m b/gcc/testsuite/objc.dg/local-decl-1.m index 4a4bfdffe7e5..8356a8ca2489 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 . */ /* { 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 e563ecbc3c24..8a362d672887 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 ba1b1aa8b359..ca07fa4bdb2a 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 194c64fac4e0..bd23493988ce 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 411caac111ad..b69a84f300be 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 . */ /* This used to be broken. */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/method-13.m b/gcc/testsuite/objc.dg/method-13.m index 592038b9d936..3e0fde5f5bab 100644 --- a/gcc/testsuite/objc.dg/method-13.m +++ b/gcc/testsuite/objc.dg/method-13.m @@ -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/objc.dg/method-14.m b/gcc/testsuite/objc.dg/method-14.m index 96982254aa9f..bc3ee12f20b2 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 . */ /* { 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 05e1a258183c..77aa3a39446b 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 @protocol DefinedProtocol diff --git a/gcc/testsuite/objc.dg/next-runtime-1.m b/gcc/testsuite/objc.dg/next-runtime-1.m index c76b6166d2ef..2ce798bc94f2 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 81f5dae0c2f2..e4c958ced72b 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 a01f004fec6c..0f79089f2784 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 922db39e7481..b551ae394361 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 21e0c53b70e9..3ddaa6431ec0 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 diff --git a/gcc/testsuite/objc.dg/param-1.m b/gcc/testsuite/objc.dg/param-1.m index 9dbf6e3fcd94..8e7781169acb 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 2da3d96d4fe3..54c3e429efed 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 23a93021e839..7070b37b38c7 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 7ff9b6052398..2bdcca56d364 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 7540fc5800c5..5bd29e5939b1 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 . */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/private-2.m b/gcc/testsuite/objc.dg/private-2.m index eff376a0c84b..d0646f5ca68f 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 . */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include @interface MySuperClass diff --git a/gcc/testsuite/objc.dg/property/property.exp b/gcc/testsuite/objc.dg/property/property.exp index 47ffcdf27db8..1c203dbcbf0a 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 0f409fc69ed4..648a4d45cc39 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 . */ /* { 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 819cf4a5089b..6b3f803d5cba 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 . */ /* { 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 2f7eb9861400..4564a9432f12 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 . */ /* { 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 35c0956ed8ec..a18b3578cbce 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 40eb0f9f5c5a..6e908727678a 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 diff --git a/gcc/testsuite/objc.dg/protocol-inheritance-1.m b/gcc/testsuite/objc.dg/protocol-inheritance-1.m index 5241b29abbd4..5367a9870be6 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 , November 2010. */ /* { dg-do compile } */ /* { dg-options "-Wno-protocol" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/protocol-inheritance-2.m b/gcc/testsuite/objc.dg/protocol-inheritance-2.m index 74c9174b5de7..9776a40f1da6 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 , November 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/protocol-optional-1.m b/gcc/testsuite/objc.dg/protocol-optional-1.m index bc4a3d07e978..29fe72ea00ff 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 , November 2010. */ /* { dg-do compile } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/selector-1.m b/gcc/testsuite/objc.dg/selector-1.m index f0781b68c63f..5ff15a2e0a72 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 6cad2ffb092e..5042104ed3ed 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 diff --git a/gcc/testsuite/objc.dg/selector-3.m b/gcc/testsuite/objc.dg/selector-3.m index c0c5f3d8fba7..94838cd3803b 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 d34f8c89cd6f..2a4947e322a1 100644 --- a/gcc/testsuite/objc.dg/selector-4.m +++ b/gcc/testsuite/objc.dg/selector-4.m @@ -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/objc.dg/shadow-1.m b/gcc/testsuite/objc.dg/shadow-1.m index 739a0d0312e7..d18fd6e5f93c 100644 --- a/gcc/testsuite/objc.dg/shadow-1.m +++ b/gcc/testsuite/objc.dg/shadow-1.m @@ -2,6 +2,7 @@ /* Author: Dimitris Papavasiliou . */ /* { dg-do compile } */ /* { dg-additional-options "-Wno-shadow-ivar" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include @interface MyClass diff --git a/gcc/testsuite/objc.dg/shadow-2.m b/gcc/testsuite/objc.dg/shadow-2.m index 16261b94a217..26447fe10818 100644 --- a/gcc/testsuite/objc.dg/shadow-2.m +++ b/gcc/testsuite/objc.dg/shadow-2.m @@ -2,6 +2,7 @@ /* Author: Dimitris Papavasiliou . */ /* { dg-do compile } */ /* { dg-additional-options "-Wno-shadow" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include @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 cb221436f02e..b72d0709044e 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 , 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 #include diff --git a/gcc/testsuite/objc.dg/special/load-category-2.m b/gcc/testsuite/objc.dg/special/load-category-2.m index 7dc74595206e..2706351da223 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 , 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 #include diff --git a/gcc/testsuite/objc.dg/special/load-category-3.m b/gcc/testsuite/objc.dg/special/load-category-3.m index b89d8f152860..215e463fcbe1 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 , 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 d770e2accb36..f561d3895d49 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 a32024df59f3..cb5812ea3273 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 7b434b4db54b..a8e422d34e98 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 #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 452993ed9165..b97e4d6a762b 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 41da5cb5fc29..6042d3c14dea 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 641595ccfe4c..4043492e6b8a 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 904ac44b2526..3e9097e11aca 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 144ea81b5e68..63792fd1d889 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 */ /* { 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 0ab177bb73c9..035de055b25f 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 */ /* { 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 80dcf495062d..5d588c50fa96 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 */ /* { 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 5cee890bba2e..6ef72a1a4c21 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 , 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 53154d321baf..8c22850e094f 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 #include diff --git a/gcc/testsuite/objc.dg/torture/dg-torture.exp b/gcc/testsuite/objc.dg/torture/dg-torture.exp index 28c2359392b3..11f50fc1dedb 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 64e53c6c23f5..3e2b3b0bd03d 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 e08f321e8c79..c792c83062f0 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 ce26b32d32bb..6c9afc26de7e 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 d02a8af219e1..64444cfe2550 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 . */ /* { 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 diff --git a/gcc/testsuite/objc.dg/type-size-3.m b/gcc/testsuite/objc.dg/type-size-3.m index bc66b0be67a0..3f65516e75e4 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 */ /* { 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 7e26da34a43d..f10ed5b0118f 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 */ /* 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 d89af32b452e..e1b11f7eef54 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 */ /* { 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 1cfc6c834812..389b0321817b 100644 --- a/gcc/testsuite/objc.dg/undeclared-selector.m +++ b/gcc/testsuite/objc.dg/undeclared-selector.m @@ -2,6 +2,7 @@ /* Author: Nicola Pero . */ /* { dg-do compile } */ /* { dg-options "-Wundeclared-selector" } */ +/* { dg-additional-options "-Wno-objc-root-class" } */ #include diff --git a/gcc/testsuite/objc.dg/volatile-1.m b/gcc/testsuite/objc.dg/volatile-1.m index 8b5381a9874c..a71363163924 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 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* Contributed by Ziemowit Laski */ +/* { dg-additional-options "-Wno-objc-root-class" } */ @interface Test -(void) test2: (volatile int) a;