summaryrefslogtreecommitdiffstats
path: root/test/Rewriter
diff options
context:
space:
mode:
Diffstat (limited to 'test/Rewriter')
-rw-r--r--test/Rewriter/finally.m2
-rw-r--r--test/Rewriter/rewrite-block-property.m15
-rw-r--r--test/Rewriter/rewrite-eh.m2
-rw-r--r--test/Rewriter/rewrite-foreach-5.m6
-rw-r--r--test/Rewriter/rewrite-foreach-6.m6
-rw-r--r--test/Rewriter/rewrite-foreach-protocol-id.m29
-rw-r--r--test/Rewriter/rewrite-vararg.m27
7 files changed, 83 insertions, 4 deletions
diff --git a/test/Rewriter/finally.m b/test/Rewriter/finally.m
index 7d160cf..ab5d838 100644
--- a/test/Rewriter/finally.m
+++ b/test/Rewriter/finally.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -rewrite-objc -verify %s -o -
+// RUN: %clang_cc1 -rewrite-objc -fobjc-exceptions -verify %s -o -
int main() {
@try {
diff --git a/test/Rewriter/rewrite-block-property.m b/test/Rewriter/rewrite-block-property.m
new file mode 100644
index 0000000..505e04b
--- /dev/null
+++ b/test/Rewriter/rewrite-block-property.m
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+// rdar://9055596
+void *sel_registerName(const char *);
+
+typedef void (^FooBlock) (int foo, int bar, int baz);
+
+@interface Foo { }
+@property (readwrite, copy, nonatomic) FooBlock fooBlock;
+@end
+
+static void Bar (Foo * foo) {
+ foo.fooBlock (1,2,3);
+}
diff --git a/test/Rewriter/rewrite-eh.m b/test/Rewriter/rewrite-eh.m
index 5bc80b5..9045f7f 100644
--- a/test/Rewriter/rewrite-eh.m
+++ b/test/Rewriter/rewrite-eh.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -rewrite-objc -o - %s
+// RUN: %clang_cc1 -rewrite-objc -fobjc-exceptions -o - %s
// rdar://7522880
@interface NSException
diff --git a/test/Rewriter/rewrite-foreach-5.m b/test/Rewriter/rewrite-foreach-5.m
index adfd7f8..7baccc3 100644
--- a/test/Rewriter/rewrite-foreach-5.m
+++ b/test/Rewriter/rewrite-foreach-5.m
@@ -1,4 +1,8 @@
-// RUN: %clang_cc1 -rewrite-objc %s -o -
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+void *sel_registerName(const char *);
+void objc_enumerationMutation(id);
@interface MyList
- (id) allKeys;
diff --git a/test/Rewriter/rewrite-foreach-6.m b/test/Rewriter/rewrite-foreach-6.m
index 2aa19ae..96b472a 100644
--- a/test/Rewriter/rewrite-foreach-6.m
+++ b/test/Rewriter/rewrite-foreach-6.m
@@ -1,8 +1,12 @@
-// RUN: %clang_cc1 %s -rewrite-objc -o -
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
// rdar://5716356
// FIXME: Should be able to pipe into clang, but code is not
// yet correct for other reasons: rdar://5716940
+void *sel_registerName(const char *);
+void objc_enumerationMutation(id);
+
@class NSNotification;
@class NSMutableArray;
diff --git a/test/Rewriter/rewrite-foreach-protocol-id.m b/test/Rewriter/rewrite-foreach-protocol-id.m
new file mode 100644
index 0000000..85d0d0d
--- /dev/null
+++ b/test/Rewriter/rewrite-foreach-protocol-id.m
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar:// 9039342
+
+void *sel_registerName(const char *);
+void objc_enumerationMutation(id);
+
+@protocol CoreDAVLeafDataPayload @end
+
+@class NSString;
+
+@interface CoreDAVAction
+- (id) context;
+@end
+
+@interface I
+{
+ id uuidsToAddActions;
+}
+@end
+
+@implementation I
+- (void) Meth {
+ for (id<CoreDAVLeafDataPayload> uuid in uuidsToAddActions) {
+ CoreDAVAction *action = 0;
+ id <CoreDAVLeafDataPayload> payload = [action context];
+ }
+}
+@end
diff --git a/test/Rewriter/rewrite-vararg.m b/test/Rewriter/rewrite-vararg.m
new file mode 100644
index 0000000..d454031
--- /dev/null
+++ b/test/Rewriter/rewrite-vararg.m
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+// rdar://9056351
+void *sel_registerName(const char *);
+
+@interface NSObject @end
+@class NSString;
+
+@protocol P
+ -(void)ParliamentFunkadelic;
+@end
+
+@interface Foo {
+ NSObject <P> *_dataSource;
+}
+@end
+
+@interface Bar { }
++(void)WhateverBar:(NSString*)format, ...;
+@end
+
+@implementation Foo
+-(void)WhateverFoo {
+ [Bar WhateverBar:@"ISyncSessionDriverDataSource %@ responded poorly", _dataSource];
+}
+@end
OpenPOWER on IntegriCloud