[cfe-commits] r151378 - /cfe/trunk/test/Rewriter/rewrite-modern-struct-ivar.mm

Fariborz Jahanian fjahanian at apple.com
Fri Feb 24 10:17:50 PST 2012


Author: fjahanian
Date: Fri Feb 24 12:17:50 2012
New Revision: 151378

URL: http://llvm.org/viewvc/llvm-project?rev=151378&view=rev
Log:
test for writing modern ivar of struct type.

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

Added: cfe/trunk/test/Rewriter/rewrite-modern-struct-ivar.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-modern-struct-ivar.mm?rev=151378&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-modern-struct-ivar.mm (added)
+++ cfe/trunk/test/Rewriter/rewrite-modern-struct-ivar.mm Fri Feb 24 12:17:50 2012
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -E %s -o %t.mm
+// RUN: %clang_cc1 -fblocks -rewrite-objc -fms-extensions %t.mm -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
+
+struct S {
+    int i1;
+    double d1;
+    void (^block1)();
+};
+
+ at interface I
+{
+  struct S struct_ivar;
+
+  struct S *pstruct_ivar;
+}
+ at end
+
+ at implementation I
+- (struct S) dMeth{ return struct_ivar; }
+ at end
+  
+// CHECK: return (*(struct S *)((char *)self + OBJC_IVAR_$_I_struct_ivar));





More information about the cfe-commits mailing list