diff options
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGenObjC/instance-method-metadata.m | 34 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/missing-atend-metadata.m | 24 | ||||
| -rw-r--r-- | clang/test/Index/rdar-8288645-invalid-code.mm | 2 | ||||
| -rw-r--r-- | clang/test/Parser/objc-missing-impl.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/missing-atend-metadata.m | 22 |
5 files changed, 58 insertions, 26 deletions
diff --git a/clang/test/CodeGenObjC/instance-method-metadata.m b/clang/test/CodeGenObjC/instance-method-metadata.m new file mode 100644 index 00000000000..ae87c7a8534 --- /dev/null +++ b/clang/test/CodeGenObjC/instance-method-metadata.m @@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -S -o %t %s +// RUN: FileCheck < %t %s + +// rdar://9072317 + +/** The problem looks like clang getting confused when a single translation unit + contains a protocol with a property and two classes that implement that protocol + and synthesize the property. +*/ + +@protocol Proto +@property (assign) id prop; +@end + +@interface NSObject @end + +@interface Foo : NSObject <Proto> { int x; } @end + +@interface Bar : NSObject <Proto> @end + +@implementation Foo +@synthesize prop; +@end + +@implementation Bar +@synthesize prop; +@end + +// CHECK: l_OBJC_$_INSTANCE_METHODS_Bar: +// CHECK-NEXT .long 24 +// CHECK-NEXT .long 2 +// CHECK-NEXT .quad L_OBJC_METH_VAR_NAME_ +// CHECK-NEXT .quad L_OBJC_METH_VAR_TYPE_ +// CHECK-NEXT .quad "-[Bar prop]" diff --git a/clang/test/CodeGenObjC/missing-atend-metadata.m b/clang/test/CodeGenObjC/missing-atend-metadata.m deleted file mode 100644 index 50e597c8d1a..00000000000 --- a/clang/test/CodeGenObjC/missing-atend-metadata.m +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: %clang_cc1 -triple i386-apple-darwin9 -emit-llvm %s -o - | FileCheck %s - -@interface I0 -@end - -@implementation I0 // expected-warning {{'@end' is missing in implementation context}} -- meth { return 0; } - -@interface I1 : I0 -@end - -@implementation I1 // expected-warning {{'@end' is missing in implementation context}} --(void) im0 { self = [super init]; } - -@interface I2 : I0 -- I2meth; -@end - -@implementation I2 // expected-warning {{'@end' is missing in implementation context}} -- I2meth { return 0; } - -@implementation I2(CAT) // expected-warning {{'@end' is missing in implementation context}} - -// CHECK: @"\01L_OBJC_CLASS_I1" = internal global diff --git a/clang/test/Index/rdar-8288645-invalid-code.mm b/clang/test/Index/rdar-8288645-invalid-code.mm index 3405f0a9327..74e2365edcf 100644 --- a/clang/test/Index/rdar-8288645-invalid-code.mm +++ b/clang/test/Index/rdar-8288645-invalid-code.mm @@ -5,4 +5,4 @@ extern "C" { @implementation Foo - (id)initWithBar:(Baz<WozBar>)pepper { // CHECK: warning: cannot find interface declaration for 'Foo' -// CHECK: warning: '@end' is missing in implementation context +// CHECK: error: '@end' is missing in implementation context diff --git a/clang/test/Parser/objc-missing-impl.m b/clang/test/Parser/objc-missing-impl.m index 05d9d6c0b23..e9c37ab1b15 100644 --- a/clang/test/Parser/objc-missing-impl.m +++ b/clang/test/Parser/objc-missing-impl.m @@ -1,2 +1,2 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -@end // expected-warning {{@end must appear in an @implementation context}} +@end // expected-error {{@end must appear in an @implementation context}} diff --git a/clang/test/SemaObjC/missing-atend-metadata.m b/clang/test/SemaObjC/missing-atend-metadata.m new file mode 100644 index 00000000000..434706d3faf --- /dev/null +++ b/clang/test/SemaObjC/missing-atend-metadata.m @@ -0,0 +1,22 @@ +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s + +@interface I0 +@end + +@implementation I0 // expected-error {{'@end' is missing in implementation context}} +- meth { return 0; } + +@interface I1 : I0 +@end + +@implementation I1 // expected-error {{'@end' is missing in implementation context}} +-(void) im0 { self = [super init]; } // expected-warning {{nstance method '-init' not found }} + +@interface I2 : I0 +- I2meth; +@end + +@implementation I2 // expected-error {{'@end' is missing in implementation context}} +- I2meth { return 0; } + +@implementation I2(CAT) // expected-error {{'@end' is missing in implementation context}} |

