diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm new file mode 100644 index 000000000..3908faf99 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/attributes/parameter-attribute-2.mm @@ -0,0 +1,25 @@ +/* Test that we get warnings for unrecognized attributes. */ +/* { dg-do compile } */ + +#include <objc/objc.h> + +@interface MyRootClass +{ + Class isa; +} +/* TODO: Emit warnings in the @interface as well. Currently we only emit + them in @implementation. */ ++ (id) method1: (id) __attribute__ ((xxxxx)) argument1; ++ (id) method2: (id) __attribute__ ((noinline)) argument1; +@end + +@implementation MyRootClass ++ (id) method1: (id) __attribute__ ((xxxxx)) argument1 /* { dg-warning ".xxxxx. attribute directive ignored" } */ +{ + return argument1; +} ++ (id) method2: (id) __attribute__ ((noinline)) argument1 /* { dg-warning ".noinline. attribute ignored" } */ +{ + return argument1; +} +@end |