aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-12-11 03:34:41 +0000
committerSteve Naroff <snaroff@apple.com>2007-12-11 03:34:41 +0000
commita924e7c06d4618046a65cc1a584c625e68030934 (patch)
tree19eb16992a3884c5b5c662dacd78262e7dc098c6
parentdb832305d35a7c9ef08bbafcf79d8da162af3374 (diff)
- 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
-rw-r--r--test/Sema/category-1.m4
-rw-r--r--test/Sema/class-def-test-1.m2
-rw-r--r--test/Sema/class-proto-1.m4
-rw-r--r--test/Sema/message.m27
-rw-r--r--test/Sema/protocol-test-2.m4
5 files changed, 34 insertions, 7 deletions
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) <p1> // expected-error {{cannot find protocol definition for 'p1', referenced by 'Category1'}}
+@interface MyClass1 (Category1) <p1> // 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) <p2, p3> @end // expected-error {{cannot find protocol definition for 'p2', referenced by 'Category'}}
+@interface MyClass1 (Category) <p2, p3> @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 <SUPER> @end // expected-error {{cannot find protocol definition for 'SUPER', referenced by 'SUPER'}}
+@interface SUPER <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 <p1> @end
-@interface E1 <p2> @end // expected-error {{cannot find protocol definition for 'p2', referenced by 'E1'}}
+@interface E1 <p2> @end // expected-warning {{cannot find protocol definition for 'p2', referenced by 'E1'}}
@protocol p2 @end
@interface I2 <p1,p2> @end
-@interface E2 <p1,p2,p3> @end // expected-error {{cannot find protocol definition for 'p3', referenced by 'E2'}}
+@interface E2 <p1,p2,p3> @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<p1>*) meth;
@end
-@protocol PROTO2<p1> // expected-error {{cannot find protocol definition for 'p1', referenced by 'PROTO2'}}
+@protocol PROTO2<p1> // expected-warning {{cannot find protocol definition for 'p1', referenced by 'PROTO2'}}
@end
@protocol p1 @end
@@ -27,5 +27,5 @@
@protocol p2 <p1>
@end
-@protocol PROTO4 <p1, p2, PROTO, PROTO3, p3> // expected-error {{cannot find protocol definition for 'p3', referenced by 'PROTO4'}}
+@protocol PROTO4 <p1, p2, PROTO, PROTO3, p3> // expected-warning {{cannot find protocol definition for 'p3', referenced by 'PROTO4'}}
@end