diff options
Diffstat (limited to 'gcc/testsuite/objc.dg/property/dynamic-2.m')
-rw-r--r-- | gcc/testsuite/objc.dg/property/dynamic-2.m | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/property/dynamic-2.m b/gcc/testsuite/objc.dg/property/dynamic-2.m new file mode 100644 index 00000000000..313d8dc8222 --- /dev/null +++ b/gcc/testsuite/objc.dg/property/dynamic-2.m @@ -0,0 +1,44 @@ +/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, October 2010. */ +/* { dg-do compile } */ + +#include <objc/objc.h> + +@interface MyRootClass +{ + Class isa; +} +@end + +@implementation MyRootClass +@end + +@dynamic isa; /* { dg-error ".@dynamic. not in @implementation context" } */ + +@interface Test : MyRootClass +{ + int v1; +} +@end +@implementation Test +@end + + +@interface Test (Category) +@end +@implementation Test (Category) +@dynamic v1; /* { dg-error ".@dynamic. can not be used in categories" } */ +@end + + +@interface AnotherTest : MyRootClass +{ +} +@property int one; +@end + +@implementation AnotherTest +@dynamic one; +@dynamic one; /* { dg-error "property .one. already specified in .@dynamic." } */ + /* { dg-message "originally specified here" "" { target *-*-* } 40 } */ +@dynamic three; /* { dg-error "no declaration of property .three. found in the interface" } */ +@end |