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-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d35fbf7f7673b5c72ee61720f1a209d4e798152f;p=gcc.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 5f10f7d6026..5dab3fa142d 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 3444760bc3d..93e5d7f40ae 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 2e1bacb3fa0..f8137ffb4c4 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 6cc5d4e2681..7c3b3b0e006 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 8343856a5c6..68e8373920d 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 1e5d87f3e63..8fb0e1510d0 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 5c715a20b68..efa2d349557 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 9ff34f92fb1..d3bb997b2aa 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 fe5f885b2d4..a3bfd9bc3c6 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 a83048bb7ed..413a0be4b2b 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 e2abb1e8a1d..f89c98121b9 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 5b568490391..1f331508a89 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 e7f6f856f8f..19e5ade8bcd 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 8263df66db9..d6ebaf227f3 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 99c5a308b8c..637846d4a08 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 a852a7a6c2f..03726dc7bed 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 b23b81de20c..6a73d248ee8 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 2be286ecfb7..ad6d0c804b1 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 226fd68b3f2..8d34ebdcc2f 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 7e8147a7008..b28c81e0569 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 896849472a7..6176832ed1c 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 05049373fa4..64383f22d99 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 5c89a9838cf..9d6658a6399 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 7f55b601fb3..293facb189f 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 69e57053969..51fe5eef083 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 692a0fcbd0a..5d367d40bd5 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 59c8f827615..34680c2ef3a 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 526934fbb82..6b796f09b29 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 42b79a9eb0a..61e79a69976 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 30a18ffa5a6..7992ebf978c 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 c3d922659aa..18ee15db446 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 291a41e96a0..9e9e4925c5e 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 c196b5151c9..ca99445df40 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 0f3b7e8ae14..1e861773b96 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 69a6494e048..bedaf53ee83 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 bbdb741f40b..5d77ffa61d2 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 55ef0f340e6..31796bc4c5c 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 9a15b8af5da..729f65c5ea6 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 93bc9028463..ccce557482f 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 faee73b8223..23656090c3c 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 dce26fa3e93..1bcb10b6faf 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 54a879e22c5..70ea8ace43d 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 3a85b163c91..6c1c76a87a3 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 eade0dcbbfa..d11dae0e6dc 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 19ac004e7b1..072d2655bb8 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 0c4fe4f0c5e..ea1da8d138f 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 1b4ce8e4799..e9ec5d7ab94 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 5751f3fd298..d417225cdfb 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 3d4d444fe27..20c4342d267 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 12c0d8b98e3..0ef4d79f9b3 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 a34d74ce90d..682adcd716e 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 a387709908c..6eaa3dd72a3 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 b71fdfab48c..bc581bec2f7 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 f1e875f9aae..60d0d8a1133 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 32cafdf314c..dc279269d24 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 cb18de95740..0a4bd6390fc 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 3e7785db86f..98bf36e17c9 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 4a877680549..0d5bb66ea32 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 34443a442fe..64d275b44bd 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 ff795d08d6a..1149d735d12 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 5fc29f90bdc..df1c8927586 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 5a222591d19..79d791ec7ab 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 eb41c8f4db0..6ddcb5b4665 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 ecc6f99c760..64035037a25 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 adfeb449e55..abd802b5423 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 4a4bfdffe7e..8356a8ca248 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 e563ecbc3c2..8a362d67288 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 ba1b1aa8b35..ca07fa4bdb2 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 194c64fac4e..bd23493988c 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 411caac111a..b69a84f300b 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 592038b9d93..3e0fde5f5ba 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 96982254aa9..bc3ee12f20b 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 05e1a258183..77aa3a39446 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 c76b6166d2e..2ce798bc94f 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 81f5dae0c2f..e4c958ced72 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 a01f004fec6..0f79089f278 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 922db39e748..b551ae39436 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 21e0c53b70e..3ddaa6431ec 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 9dbf6e3fcd9..8e7781169ac 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 2da3d96d4fe..54c3e429efe 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 23a93021e83..7070b37b38c 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 7ff9b605239..2bdcca56d36 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 7540fc5800c..5bd29e5939b 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 eff376a0c84..d0646f5ca68 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 47ffcdf27db..1c203dbcbf0 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 0f409fc69ed..648a4d45cc3 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 819cf4a5089..6b3f803d5cb 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 2f7eb986140..4564a9432f1 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 35c0956ed8e..a18b3578cbc 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 40eb0f9f5c5..6e908727678 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 5241b29abbd..5367a9870be 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 74c9174b5de..9776a40f1da 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 bc4a3d07e97..29fe72ea00f 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 f0781b68c63..5ff15a2e0a7 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 6cad2ffb092..5042104ed3e 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 c0c5f3d8fba..94838cd3803 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 d34f8c89cd6..2a4947e322a 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 739a0d0312e..d18fd6e5f93 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 16261b94a21..26447fe1081 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 cb221436f02..b72d0709044 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 7dc74595206..2706351da22 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 b89d8f15286..215e463fcbe 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 d770e2accb3..f561d3895d4 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 a32024df59f..cb5812ea327 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 7b434b4db54..a8e422d34e9 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 452993ed916..b97e4d6a762 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 41da5cb5fc2..6042d3c14de 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 641595ccfe4..4043492e6b8 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 904ac44b252..3e9097e11ac 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 144ea81b5e6..63792fd1d88 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 0ab177bb73c..035de055b25 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 80dcf495062..5d588c50fa9 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 5cee890bba2..6ef72a1a4c2 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 53154d321ba..8c22850e094 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 28c2359392b..11f50fc1ded 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 64e53c6c23f..3e2b3b0bd03 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 e08f321e8c7..c792c83062f 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 ce26b32d32b..6c9afc26de7 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 d02a8af219e..64444cfe255 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 bc66b0be67a..3f65516e75e 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 7e26da34a43..f10ed5b0118 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 d89af32b452..e1b11f7eef5 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 1cfc6c83481..389b0321817 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 8b5381a9874..a7136316392 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;