From: Steve Naroff Date: Tue, 11 Dec 2007 03:34:41 +0000 (+0000) Subject: - Tweak several tests to be compatible with my last commit. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a924e7c06d4618046a65cc1a584c625e68030934;p=clang - Tweak several tests to be compatible with my last commit. - Add a test to message.m for an unusual case for GCC compat (as suggested by Chris). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44842 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/category-1.m b/test/Sema/category-1.m index d0f8d6facd..40993e8762 100644 --- a/test/Sema/category-1.m +++ b/test/Sema/category-1.m @@ -4,7 +4,7 @@ @protocol p1,p2,p3; -@interface MyClass1 (Category1) // expected-error {{cannot find protocol definition for 'p1', referenced by 'Category1'}} +@interface MyClass1 (Category1) // expected-warning {{cannot find protocol definition for 'p1', referenced by 'Category1'}} @end @interface MyClass1 (Category1) // expected-error {{duplicate interface declaration for category 'MyClass1(Category1)'}} @@ -27,7 +27,7 @@ @protocol p3 @end -@interface MyClass1 (Category) @end // expected-error {{cannot find protocol definition for 'p2', referenced by 'Category'}} +@interface MyClass1 (Category) @end // expected-warning {{cannot find protocol definition for 'p2', referenced by 'Category'}} @interface MyClass (Category) @end // expected-error {{cannot find interface declaration for 'MyClass'}} diff --git a/test/Sema/class-def-test-1.m b/test/Sema/class-def-test-1.m index 94a01cc255..72702d9d18 100644 --- a/test/Sema/class-def-test-1.m +++ b/test/Sema/class-def-test-1.m @@ -2,7 +2,7 @@ @protocol SUPER; -@interface SUPER @end // expected-error {{cannot find protocol definition for 'SUPER', referenced by 'SUPER'}} +@interface SUPER @end // expected-warning {{cannot find protocol definition for 'SUPER', referenced by 'SUPER'}} typedef int INTF; // expected-error {{previous definition is here}} diff --git a/test/Sema/class-proto-1.m b/test/Sema/class-proto-1.m index 599290b1dd..f38eaea4c1 100644 --- a/test/Sema/class-proto-1.m +++ b/test/Sema/class-proto-1.m @@ -14,14 +14,14 @@ @interface I1 @end -@interface E1 @end // expected-error {{cannot find protocol definition for 'p2', referenced by 'E1'}} +@interface E1 @end // expected-warning {{cannot find protocol definition for 'p2', referenced by 'E1'}} @protocol p2 @end @interface I2 @end -@interface E2 @end // expected-error {{cannot find protocol definition for 'p3', referenced by 'E2'}} +@interface E2 @end // expected-warning {{cannot find protocol definition for 'p3', referenced by 'E2'}} @class U1, U2; diff --git a/test/Sema/message.m b/test/Sema/message.m index e7717a0485..dc50a19c81 100644 --- a/test/Sema/message.m +++ b/test/Sema/message.m @@ -9,3 +9,30 @@ - (void) meth { [self contents]; } @end +typedef struct _NSPoint { + float x; + float y; +} NSPoint; + +typedef struct _NSSize { + float width; + float height; +} NSSize; + +typedef struct _NSRect { + NSPoint origin; + NSSize size; +} NSRect; + +@interface AnyClass +- (NSRect)rect; +@end + +@class Helicopter; + +static void func(Helicopter *obj) { + // Note that the proto for "rect" is found in the global pool even when + // a statically typed object's class interface isn't in scope! This + // behavior isn't very desirable, however wee need it for GCC compatibility. + NSRect r = [obj rect]; +} diff --git a/test/Sema/protocol-test-2.m b/test/Sema/protocol-test-2.m index f891995bc6..f323745c5d 100644 --- a/test/Sema/protocol-test-2.m +++ b/test/Sema/protocol-test-2.m @@ -10,7 +10,7 @@ - (INTF1*) meth; @end -@protocol PROTO2 // expected-error {{cannot find protocol definition for 'p1', referenced by 'PROTO2'}} +@protocol PROTO2 // expected-warning {{cannot find protocol definition for 'p1', referenced by 'PROTO2'}} @end @protocol p1 @end @@ -27,5 +27,5 @@ @protocol p2 @end -@protocol PROTO4 // expected-error {{cannot find protocol definition for 'p3', referenced by 'PROTO4'}} +@protocol PROTO4 // expected-warning {{cannot find protocol definition for 'p3', referenced by 'PROTO4'}} @end