[cfe-commits] r156552 - /cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm

Fariborz Jahanian fjahanian at apple.com
Thu May 10 10:05:15 PDT 2012


Author: fjahanian
Date: Thu May 10 12:05:15 2012
New Revision: 156552

URL: http://llvm.org/viewvc/llvm-project?rev=156552&view=rev
Log:
Test for previously checked in patch.
// rdar://11374235

Added:
    cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm

Added: cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm?rev=156552&view=auto
==============================================================================
--- cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm (added)
+++ cfe/trunk/test/Rewriter/rewrite-modern-default-property-synthesis.mm Thu May 10 12:05:15 2012
@@ -0,0 +1,80 @@
+// RUN: %clang_cc1 -E %s -o %t.mm
+// RUN: %clang_cc1 -x objective-c++ -fms-extensions -fobjc-default-synthesize-properties -rewrite-objc %t.mm -o %t-rw.cpp 
+// RUN: FileCheck --input-file=%t-rw.cpp %s
+// RUN: %clang_cc1 -fsyntax-only  -Werror -DSEL="void *" -Did="struct objc_object *" -Wno-attributes -Wno-address-of-temporary -U__declspec -D"__declspec(X)=" %t-rw.cpp
+// rdar://11374235
+
+extern "C" void *sel_registerName(const char *);
+
+ at interface NSObject 
+- (void) release;
+- (id) retain;
+ at end
+ at class NSString;
+
+ at interface SynthItAll : NSObject
+ at property int howMany;
+ at property (retain) NSString* what; 
+ at end
+
+ at implementation SynthItAll
+ at end
+
+
+ at interface SynthSetter : NSObject
+ at property (nonatomic) int howMany; 
+ at property (nonatomic, retain) NSString* what; 
+ at end
+
+ at implementation SynthSetter
+
+- (int) howMany {
+    return _howMany;
+}
+// - (void) setHowMany: (int) value
+
+- (NSString*) what {
+    return _what;
+}
+// - (void) setWhat: (NSString*) value    
+ at end
+
+
+ at interface SynthGetter : NSObject
+ at property (nonatomic) int howMany;
+ at property (nonatomic, retain) NSString* what;
+ at end
+
+ at implementation SynthGetter
+// - (int) howMany
+- (void) setHowMany: (int) value {
+    _howMany = value;
+}
+
+// - (NSString*) what
+- (void) setWhat: (NSString*) value {
+    if (_what != value) {
+        [_what release];
+        _what = [value retain];
+    }
+}
+ at end
+
+typedef struct {
+        int x:1;
+        int y:1;
+} TBAR;
+
+ at interface NONAME
+{
+  TBAR _bar;
+}
+ at property TBAR bad;
+ at end
+
+ at implementation NONAME
+ at end
+
+// CHECK: (*(int *)((char *)self + OBJC_IVAR_$_SynthItAll$_howMany)) = howMany;
+// CHECK: return (*(int *)((char *)self + OBJC_IVAR_$_SynthGetter$_howMany));
+// CHECK: (*(TBAR *)((char *)self + OBJC_IVAR_$_NONAME$_bad)) = bad;





More information about the cfe-commits mailing list