summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-11 21:39:00 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-12-11 21:39:00 +0000
commit3f72934bba66d46c756f6c1cc165154c4ca69ec1 (patch)
tree8b90f5ab5b8c70b6860068f63715fa92acae5e1a /clang/test
parente439f92a6ca5e9b4fd8d9cfbbdb6cc2e376dd088 (diff)
downloadbcm5719-llvm-3f72934bba66d46c756f6c1cc165154c4ca69ec1.tar.gz
bcm5719-llvm-3f72934bba66d46c756f6c1cc165154c4ca69ec1.zip
[objcmt] When whitelisting the headers we want to modify, allow changing the
the ObjC implementation declarations, just don't change implementations for classes that are not in the whitelisted headers. For example, if we change a method to return 'instancetype' we should also update the method definition in the implementation. llvm-svn: 197075
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/ARCMT/whitelisted/header1.h1
-rw-r--r--clang/test/ARCMT/whitelisted/header1.h.result1
-rw-r--r--clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m18
-rw-r--r--clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result18
-rw-r--r--clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m4
5 files changed, 40 insertions, 2 deletions
diff --git a/clang/test/ARCMT/whitelisted/header1.h b/clang/test/ARCMT/whitelisted/header1.h
index a3014eb5b65..d94b9f7d9eb 100644
--- a/clang/test/ARCMT/whitelisted/header1.h
+++ b/clang/test/ARCMT/whitelisted/header1.h
@@ -2,4 +2,5 @@
@interface I1 : NSObject
-(int)prop;
-(void)setProp:(int)p;
++(id)i1;
@end
diff --git a/clang/test/ARCMT/whitelisted/header1.h.result b/clang/test/ARCMT/whitelisted/header1.h.result
index 7808fc8a6a3..65cbd2621f6 100644
--- a/clang/test/ARCMT/whitelisted/header1.h.result
+++ b/clang/test/ARCMT/whitelisted/header1.h.result
@@ -1,4 +1,5 @@
@interface I1 : NSObject
@property (nonatomic) int prop;
++(instancetype)i1;
@end
diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m
new file mode 100644
index 00000000000..d734eaa10bd
--- /dev/null
+++ b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result
+
+@interface NSObject
++ (id)alloc;
+@end
+
+#include "header1.h"
+#include "header2.h"
+
+@interface I2(cat)
+-(id)initInCat;
+@end
+
+@implementation I1
++(id)i1 {}
+@end
diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result
new file mode 100644
index 00000000000..b936b52b729
--- /dev/null
+++ b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist-impl.m.result
@@ -0,0 +1,18 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %s.result
+
+@interface NSObject
++ (id)alloc;
+@end
+
+#include "header1.h"
+#include "header2.h"
+
+@interface I2(cat)
+-(id)initInCat;
+@end
+
+@implementation I1
++(instancetype)i1 {}
+@end
diff --git a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m
index 1b44c9a6d9f..bef82c8667d 100644
--- a/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m
+++ b/clang/test/ARCMT/whitelisted/objcmt-with-whitelist.m
@@ -1,7 +1,7 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -objcmt-migrate-readwrite-property %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result %S/header2.h.result
-// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
+// RUN: %clang_cc1 -objcmt-migrate-readwrite-property -objcmt-migrate-instancetype -objcmt-white-list-dir-path=%S/Inputs %s -triple x86_64-apple-darwin11 -migrate -o %t.remap
// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %S/header1.h.result
@interface NSObject
OpenPOWER on IntegriCloud