1 // RUN: %clang_cc1 -E %s -o %t.mm 2 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s 3 // rdar://11144048 4 5 @class NSString; 6 7 @interface NSObject { 8 Class isa; 9 } 10 @end 11 12 @interface Sub : NSObject { 13 int subIvar; 14 NSString *nsstring; 15 @private 16 id PrivateIvar; 17 } 18 @end 19 20 @implementation Sub 21 - (id) MyNSString { return subIvar ? PrivateIvar : nsstring; } 22 @end 23 24 @interface NSString @end 25 @implementation NSString @end 26 27 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" __declspec(dllimport) unsigned long OBJC_IVAR_$_Sub$subIvar; 28 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" unsigned long OBJC_IVAR_$_Sub$PrivateIvar; 29 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" __declspec(dllimport) unsigned long OBJC_IVAR_$_Sub$nsstring; 30 // CHECK: #pragma warning(disable:4273) 31 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" __declspec(dllexport) unsigned long int OBJC_IVAR_$_Sub$subIvar 32 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" __declspec(dllexport) unsigned long int OBJC_IVAR_$_Sub$nsstring 33 // CHECK: __declspec(allocate(".objc_ivar$B")) extern "C" unsigned long int OBJC_IVAR_$_Sub$PrivateIvar 34 // CHECK: extern "C" __declspec(dllimport) struct _class_t OBJC_METACLASS_$_NSObject; 35 // CHECK: extern "C" __declspec(dllexport) struct _class_t OBJC_METACLASS_$_Sub 36 // CHECK: extern "C" __declspec(dllimport) struct _class_t OBJC_CLASS_$_NSObject; 37 // CHECK: extern "C" __declspec(dllexport) struct _class_t OBJC_CLASS_$_Sub 38 // CHECK: extern "C" __declspec(dllexport) struct _class_t OBJC_CLASS_$_NSString; 39 // CHECK: extern "C" __declspec(dllexport) struct _class_t OBJC_METACLASS_$_NSString 40 // CHECK: extern "C" __declspec(dllexport) struct _class_t OBJC_CLASS_$_NSString 41