summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-06-18 00:53:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-06-18 00:53:41 +0000
commit90b6a2a6a78273b0df86485c887bb66c3daaaadf (patch)
tree1c061ed10b66cdc3877a25cdaa9a9da3d9298823 /clang/test
parent0f3f9f78f8e8b0e13cef69edf22bc62860f5e9ea (diff)
downloadbcm5719-llvm-90b6a2a6a78273b0df86485c887bb66c3daaaadf.tar.gz
bcm5719-llvm-90b6a2a6a78273b0df86485c887bb66c3daaaadf.zip
[arcmt] Fix the ARC migrator. -arcmt-modify requires running before the initialization of SourceManager
because it is going to modify the input file. llvm-svn: 133323
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/ARCMT/alloc-with-zone-check.m2
-rw-r--r--clang/test/ARCMT/atautorelease-check.m2
-rw-r--r--clang/test/ARCMT/checking.m2
-rw-r--r--clang/test/ARCMT/cxx-checking.mm2
-rw-r--r--clang/test/ARCMT/nonobjc-to-objc-cast-2.m2
-rw-r--r--clang/test/ARCMT/releases-driver.m68
-rw-r--r--clang/test/ARCMT/releases-driver.m.result61
7 files changed, 134 insertions, 5 deletions
diff --git a/clang/test/ARCMT/alloc-with-zone-check.m b/clang/test/ARCMT/alloc-with-zone-check.m
index a987fa8b84e..01924a99879 100644
--- a/clang/test/ARCMT/alloc-with-zone-check.m
+++ b/clang/test/ARCMT/alloc-with-zone-check.m
@@ -1,4 +1,4 @@
-// RUN: arcmt-test -check-only -verify --args %s
+// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s
#if __has_feature(objc_arr)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
diff --git a/clang/test/ARCMT/atautorelease-check.m b/clang/test/ARCMT/atautorelease-check.m
index 126642cd380..6528f3e62d1 100644
--- a/clang/test/ARCMT/atautorelease-check.m
+++ b/clang/test/ARCMT/atautorelease-check.m
@@ -1,4 +1,4 @@
-// RUN: arcmt-test -check-only -verify --args %s
+// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s
#if __has_feature(objc_arr)
#define NS_AUTOMATED_REFCOUNT_UNAVAILABLE __attribute__((unavailable("not available in automatic reference counting mode")))
diff --git a/clang/test/ARCMT/checking.m b/clang/test/ARCMT/checking.m
index ffb245e8bb6..62387fa23b4 100644
--- a/clang/test/ARCMT/checking.m
+++ b/clang/test/ARCMT/checking.m
@@ -1,4 +1,4 @@
-// RUN: arcmt-test -check-only -verify --args %s
+// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s
#include "Common.h"
diff --git a/clang/test/ARCMT/cxx-checking.mm b/clang/test/ARCMT/cxx-checking.mm
index 667138c9747..c298b94b82b 100644
--- a/clang/test/ARCMT/cxx-checking.mm
+++ b/clang/test/ARCMT/cxx-checking.mm
@@ -1,4 +1,4 @@
-// RUN: arcmt-test -check-only -verify --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fblocks -Warc-abi %s
+// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fblocks -Warc-abi %s
// Classes that have an Objective-C object pointer.
struct HasObjectMember0 { // expected-warning{{'HasObjectMember0' cannot be shared between ARC and non-ARC code; add a copy constructor, a copy assignment operator, and a destructor to make it ABI-compatible}}
diff --git a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
index dba5227fae9..46ef02400e8 100644
--- a/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
+++ b/clang/test/ARCMT/nonobjc-to-objc-cast-2.m
@@ -1,4 +1,4 @@
-// RUN: arcmt-test -check-only -verify --args %s
+// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s
typedef int BOOL;
typedef const struct __CFString * CFStringRef;
diff --git a/clang/test/ARCMT/releases-driver.m b/clang/test/ARCMT/releases-driver.m
new file mode 100644
index 00000000000..a016b26f448
--- /dev/null
+++ b/clang/test/ARCMT/releases-driver.m
@@ -0,0 +1,68 @@
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: cp %s %t
+// RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -fobjc-nonfragile-abi -x objective-c %t
+// RUN: diff %t %s.result
+// RUN: rm %t
+
+typedef int BOOL;
+
+id IhaveSideEffect();
+
+@protocol NSObject
+- (BOOL)isEqual:(id)object;
+- (id)retain;
+- (oneway void)release;
+@end
+
+@interface NSObject <NSObject> {}
+@end
+
+@interface Foo : NSObject {
+ id bar;
+}
+@property (retain) id bar;
+-(void)test:(id)obj;
+@end
+
+@implementation Foo
+
+@synthesize bar;
+
+-(void)test:(id)obj {
+ id x = self.bar;
+ [x retain];
+ self.bar = obj;
+ // do stuff with x;
+ [x release];
+
+ [IhaveSideEffect() release];
+
+ [x release], x = 0;
+}
+
+@end
+
+void func(Foo *p) {
+ [p release];
+ (([p release]));
+}
+
+@interface Baz {
+ id <NSObject> _foo;
+}
+@end
+
+@implementation Baz
+- dealloc {
+ [_foo release];
+ return 0;
+}
+@end
+
+#define RELEASE_MACRO(x) [x release]
+#define RELEASE_MACRO2(x) RELEASE_MACRO(x)
+
+void test2(id p) {
+ RELEASE_MACRO(p);
+ RELEASE_MACRO2(p);
+}
diff --git a/clang/test/ARCMT/releases-driver.m.result b/clang/test/ARCMT/releases-driver.m.result
new file mode 100644
index 00000000000..247cad16129
--- /dev/null
+++ b/clang/test/ARCMT/releases-driver.m.result
@@ -0,0 +1,61 @@
+// RUN: %clang_cc1 -fobjc-nonfragile-abi -fblocks -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: cp %s %t
+// RUN: %clang_cc1 -arcmt-modify -triple x86_64-apple-macosx10.6 -fobjc-nonfragile-abi -x objective-c %t
+// RUN: diff %t %s.result
+// RUN: rm %t
+
+typedef int BOOL;
+
+id IhaveSideEffect();
+
+@protocol NSObject
+- (BOOL)isEqual:(id)object;
+- (id)retain;
+- (oneway void)release;
+@end
+
+@interface NSObject <NSObject> {}
+@end
+
+@interface Foo : NSObject {
+ id bar;
+}
+@property (retain) id bar;
+-(void)test:(id)obj;
+@end
+
+@implementation Foo
+
+@synthesize bar;
+
+-(void)test:(id)obj {
+ id x = self.bar;
+ self.bar = obj;
+ // do stuff with x;
+
+ IhaveSideEffect();
+
+ x = 0;
+}
+
+@end
+
+void func(Foo *p) {
+}
+
+@interface Baz {
+ id <NSObject> _foo;
+}
+@end
+
+@implementation Baz
+- dealloc {
+ return 0;
+}
+@end
+
+#define RELEASE_MACRO(x) [x release]
+#define RELEASE_MACRO2(x) RELEASE_MACRO(x)
+
+void test2(id p) {
+}
OpenPOWER on IntegriCloud