]> granicus.if.org Git - clang/commitdiff
more objective-c modern translator ivar tests.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 24 Feb 2012 18:03:42 +0000 (18:03 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 24 Feb 2012 18:03:42 +0000 (18:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151376 91177308-0d34-0410-b5e6-96231b3b80d8

test/Rewriter/rewrite-modern-nested-ivar.mm [new file with mode: 0644]

diff --git a/test/Rewriter/rewrite-modern-nested-ivar.mm b/test/Rewriter/rewrite-modern-nested-ivar.mm
new file mode 100644 (file)
index 0000000..e2b5ea2
--- /dev/null
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -E %s -o %t.m
+// RUN: %clang_cc1 -fblocks -rewrite-objc -fms-extensions %t.m -o %t-rw.cpp 
+// RUN: FileCheck --input-file=%t-rw.cpp %s
+// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+@interface NSURLResponse {
+@public
+  NSURLResponse *InnerResponse;
+}
+@end
+
+@interface NSCachedURLResponseInternal 
+{
+    @public
+    NSURLResponse *response;
+}
+@end
+
+@interface NSCachedURLResponse
+{
+    @private
+    NSCachedURLResponseInternal *_internal;
+}
+- (void) Meth;
+@end
+
+@implementation NSCachedURLResponse
+- (void) Meth {
+    _internal->response->InnerResponse = 0;
+  }
+@end
+
+// CHECK: (*(NSURLResponse **)((char *)(*(NSURLResponse **)((char *)(*(NSCachedURLResponseInternal **)((char *)self + OBJC_IVAR_$_NSCachedURLResponse__internal)) + OBJC_IVAR_$_NSCachedURLResponseInternal_response)) + OBJC_IVAR_$_NSURLResponse_InnerResponse)) = 0;