summaryrefslogtreecommitdiff
path: root/test/Rewriter
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-11-22 18:43:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-11-22 18:43:41 +0000
commit9f8ce20da1c4abeadfab0baefed51e2c7111b82b (patch)
treee0abf98ebbbb3f57fbbd7defba66e5402a4274b2 /test/Rewriter
parent674e54c167eab0be7a54bca7082c07d2f1d0c8cc (diff)
downloadclang-9f8ce20da1c4abeadfab0baefed51e2c7111b82b.tar.gz
ObjectiveC modern translator. Fixes a translation bug
tranalation @protocol expression. // rdar://15517895 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Rewriter')
-rw-r--r--test/Rewriter/protocol-rewrite-1.m27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/Rewriter/protocol-rewrite-1.m b/test/Rewriter/protocol-rewrite-1.m
index 541b7ee9ba..0c5104fbb5 100644
--- a/test/Rewriter/protocol-rewrite-1.m
+++ b/test/Rewriter/protocol-rewrite-1.m
@@ -1,4 +1,7 @@
-// RUN: %clang_cc1 -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o -
+// RUN: %clang_cc1 -x objective-c -Wno-objc-root-class -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: FileCheck --input-file=%t-rw.cpp %s
+// rdar://9846759
+// rdar://15517895
typedef struct MyWidget {
int a;
@@ -46,3 +49,25 @@ int main(void) {
return 0;
}
+
+// rdar://15517895
+@class NSObject;
+
+@interface NSProtocolChecker
++ (id)protocolCheckerWithTarget:(NSObject *)anObject protocol:(Protocol *)aProtocol;
+@end
+
+@protocol NSConnectionVersionedProtocol
+@end
+
+
+@interface NSConnection @end
+
+@implementation NSConnection
+- (void) Meth {
+ [NSProtocolChecker protocolCheckerWithTarget:0 protocol:@protocol(NSConnectionVersionedProtocol)];
+}
+@end
+
+// CHECK: static struct _protocol_t *_OBJC_PROTOCOL_REFERENCE_$_NSConnectionVersionedProtocol = &_OBJC_PROTOCOL_NSConnectionVersionedProtocol
+// CHECK: sel_registerName("protocolCheckerWithTarget:protocol:"), (NSObject *)0, (Protocol *)_OBJC_PROTOCOL_REFERENCE_$_NSConnectionVersionedProtocol