diff options
author | Nicola Pero <nicola.pero@meta-innovation.com> | 2010-10-18 23:28:20 +0000 |
---|---|---|
committer | Nicola Pero <nicola@gcc.gnu.org> | 2010-10-18 23:28:20 +0000 |
commit | da57d1b98f8ca9d1304fe66ff14315f12ce2a14f (patch) | |
tree | 59330bf1f36ce8580abaac8db170b72523706080 /gcc/testsuite/objc.dg | |
parent | 0069111f9c747028548f8c5dd7b91c4e5358039d (diff) | |
download | gcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.zip gcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.tar.gz gcc-da57d1b98f8ca9d1304fe66ff14315f12ce2a14f.tar.bz2 |
In gcc/: 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
In gcc/:
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented parsing @synthesize and @dynamic for Objective-C.
* c-parser.c (c_parser_external_declaration): Recognize
RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
(c_parser_objc_at_synthesize_declaration): New.
(c_parser_objc_at_dynamic_declaration): New.
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_class_declaration): After finding an
error, parse the whole declaration then reset parser->error.
In gcc/cp/:
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented parsing @synthesize and @dynamic for Objective-C++.
* parser.c (cp_parser_objc_method_definition_list): Recognize
RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
(cp_parser_objc_at_dynamic_declaration): New.
(cp_parser_objc_at_synthesize_declaration): New.
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
* parser.c (cp_parser_objc_identifier_list): Check the return
value of cp_parser_identifier and react if it is error_mark_node.
In gcc/objc/:
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented parsing @synthesize and @dynamic for
Objective-C/Objective-C++.
* objc-act.c (objc_add_synthesize_declaration): New.
(objc_add_dynamic_declaration): New.
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc-act.c (lookup_and_install_protocols): Return NULL if passed
error_mark_node.
In gcc/testsuite/:
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
Implemented parsing @synthesize and @dynamic for
Objective-C/Objective-C++.
* objc.dg/property/dynamic-1.m: New.
* objc.dg/property/synthesize-1.m: New.
* obj-c++.dg/property/dynamic-1.mm: New.
* obj-c++.dg/property/synthesize-1.mm: New.
2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/at-class-1.m: New.
* objc.dg/at-class-1.mm: New.
From-SVN: r165667
Diffstat (limited to 'gcc/testsuite/objc.dg')
-rw-r--r-- | gcc/testsuite/objc.dg/at-class-1.m | 11 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/property/dynamic-1.m | 30 | ||||
-rw-r--r-- | gcc/testsuite/objc.dg/property/synthesize-1.m | 31 |
3 files changed, 72 insertions, 0 deletions
diff --git a/gcc/testsuite/objc.dg/at-class-1.m b/gcc/testsuite/objc.dg/at-class-1.m new file mode 100644 index 0000000..63721aa --- /dev/null +++ b/gcc/testsuite/objc.dg/at-class-1.m @@ -0,0 +1,11 @@ +/* Test @class. */ +/* { dg-do compile } */ + +@class Object; /* Ok */ + +@class Object, ; /* { dg-error "expected identifier" } */ +@class Object, ; /* { dg-error "expected identifier" } */ +@class Object, AnotherObject, ; /* { dg-error "expected identifier" } */ +@class Object, AnotherObject, TestObject ; /* Ok */ + +@class Object /* { dg-error "expected .;." } */ diff --git a/gcc/testsuite/objc.dg/property/dynamic-1.m b/gcc/testsuite/objc.dg/property/dynamic-1.m new file mode 100644 index 0000000..b91a030 --- /dev/null +++ b/gcc/testsuite/objc.dg/property/dynamic-1.m @@ -0,0 +1,30 @@ +/* { 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; + int v2; + int v3; + int v4; +} +@end + +@implementation Test +@dynamic; /* { dg-error "expected identifier" } */ +@dynamic v1, ; /* { dg-error "expected identifier" } */ +@dynamic v1, v2, v3; /* { dg-error ".@dynamic. is not supported in this version of the compiler" } */ +@dynamic v4; /* { dg-error ".@dynamic. is not supported in this version of the compiler" } */ +@end diff --git a/gcc/testsuite/objc.dg/property/synthesize-1.m b/gcc/testsuite/objc.dg/property/synthesize-1.m new file mode 100644 index 0000000..09085d8 --- /dev/null +++ b/gcc/testsuite/objc.dg/property/synthesize-1.m @@ -0,0 +1,31 @@ +/* { dg-do compile } */ + +#include <objc/objc.h> + +@interface MyRootClass +{ + Class isa; +} +@end + +@implementation MyRootClass +@end + +@synthesize isa; /* { dg-error ".@synthesize. not in @implementation context" } */ + +@interface Test : MyRootClass +{ + int v1; + int v2; + int v3; + int v4; +} +@end + +@implementation Test +@synthesize; /* { dg-error "expected identifier" } */ +@synthesize v1, ; /* { dg-error "expected identifier" } */ +@synthesize v1, v2 = ; /* { dg-error "expected identifier" } */ +@synthesize v1, v2=v2, v3 = v3,v4; /* { dg-error ".@synthesize. is not supported in this version of the compiler" } */ +@synthesize v4; /* { dg-error ".@synthesize. is not supported in this version of the compiler" } */ +@end |