summaryrefslogtreecommitdiffstats
path: root/test/FixIt/typo.m
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2010-05-27 15:17:06 +0000
committerrdivacky <rdivacky@FreeBSD.org>2010-05-27 15:17:06 +0000
commit53992adde3eda3ccf9da63bc7e45673f043de18f (patch)
tree3558f327a6f9ab59c5d7a06528d84e1560445247 /test/FixIt/typo.m
parent7e411337c0ed226dace6e07f1420486768161308 (diff)
downloadFreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.zip
FreeBSD-src-53992adde3eda3ccf9da63bc7e45673f043de18f.tar.gz
Update clang to r104832.
Diffstat (limited to 'test/FixIt/typo.m')
-rw-r--r--test/FixIt/typo.m50
1 files changed, 29 insertions, 21 deletions
diff --git a/test/FixIt/typo.m b/test/FixIt/typo.m
index f161bb8..7197bc7 100644
--- a/test/FixIt/typo.m
+++ b/test/FixIt/typo.m
@@ -1,17 +1,18 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-// RUN: cp %s %t
-// RUN: %clang_cc1 -fsyntax-only -fixit %t || true
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Werror -x objective-c %t
-// XFAIL: *
+// RUN: %clang_cc1 -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -DNON_FIXITS -verify %s
+// RUN: %clang -E -P %s -o %t
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fixit %t || true
+// RUN: %clang_cc1 -x objective-c -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -pedantic -Werror %t
@interface NSString // expected-note{{'NSString' declared here}}
+ (int)method:(int)x;
@end
+#ifdef NON_FIXITS
void test() {
// FIXME: not providing fix-its
NSstring *str = @"A string"; // expected-error{{use of undeclared identifier 'NSstring'; did you mean 'NSString'?}}
}
+#endif
@protocol P1
@optional
@@ -80,18 +81,23 @@ void test2(Collide *a) {
a->vale = 17; // expected-error{{'Collide' does not have a member named 'vale'; did you mean 'value'?}}
}
+#ifdef NON_FIXITS
@interface Derived : Collid // expected-error{{cannot find interface declaration for 'Collid', superclass of 'Derived'; did you mean 'Collide'?}}
@end
+#endif
+#ifdef NON_FIXITS
@protocol NetworkSocket // expected-note{{'NetworkSocket' declared here}}
- (int)send:(void*)buffer bytes:(int)bytes;
@end
@interface IPv6 <Network_Socket> // expected-error{{cannot find protocol declaration for 'Network_Socket'; did you mean 'NetworkSocket'?}}
@end
+#endif
@interface Super
-- (int)method;
+- (int)method; // expected-note{{using}}
+- (int)method2;
@end
@interface Sub : Super
@@ -105,6 +111,18 @@ void test2(Collide *a) {
@end
+double *isupper(int);
+
+@interface Sub2 : Super
+- (int)method2;
+@end
+
+@implementation Sub2
+- (int)method2 {
+ return [supper method2]; // expected-error{{unknown receiver 'supper'; did you mean 'super'?}}
+}
+@end
+
@interface Ivar
@end
@@ -112,29 +130,19 @@ void test2(Collide *a) {
@property (retain) id ivar;
@end
+#ifdef NON_FIXITS
@interface User <Proto>
-- (void)method;
+- (void)method; // expected-note{{also found}}
@end
@implementation User
@synthesize ivar;
- (void)method {
- [ivar method]; // Test that we don't correct 'ivar' to 'Ivar'
+ // Test that we don't correct 'ivar' to 'Ivar' e
+ [ivar method]; // expected-warning{{multiple methods named 'method' found}}
}
@end
+#endif
-@interface User2
-@end
-@interface User2 (Cat) < Proto>
-- (void)method;
-@end
-
-@implementation User2 (Cat)
-@synthesize ivar;
-
-- (void)method {
- [ivar method]; // Test that we don't correct 'ivar' to 'Ivar'
-}
-@end
OpenPOWER on IntegriCloud