[cfe-commits] r151208 - /cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm

Fariborz Jahanian fjahanian at apple.com
Wed Feb 22 14:32:05 PST 2012


Author: fjahanian
Date: Wed Feb 22 16:32:05 2012
New Revision: 151208

URL: http://llvm.org/viewvc/llvm-project?rev=151208&view=rev
Log:
another test for modern ivar access rewrite.


Added:
    cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm

Added: cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm?rev=151208&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm (added)
+++ cfe/trunk/test/Rewriter/rewrite-cast-ivar-modern-access.mm Wed Feb 22 16:32:05 2012
@@ -0,0 +1,46 @@
+// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp 
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"Class=void*" -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+
+ at interface F {
+  int supervar;
+}
+ at end
+
+ at interface G : F {
+ at public
+  int ivar;
+}
+ at end
+
+ at implementation G
+- (void)foo:(F *)arg {
+        int q = arg->supervar;
+        int v = ((G *)arg)->ivar;
+}
+ at end
+
+void objc_assign_strongCast(id);
+void __CFAssignWithWriteBarrier(void **location, void *value) {
+        objc_assign_strongCast((id)value);
+}
+
+// radar 7607605
+ at interface RealClass {
+        @public
+        int f;
+}
+ at end
+
+ at implementation RealClass
+ at end
+
+ at interface Foo {
+        id reserved;
+}
+ at end
+
+ at implementation Foo
+- (void)bar {
+        ((RealClass*)reserved)->f = 99;
+}
+ at end





More information about the cfe-commits mailing list