1*67e74705SXin Li// RUN: rm -rf %t 2*67e74705SXin Li// RUN: %clang_cc1 -objcmt-migrate-all -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11 3*67e74705SXin Li// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result 4*67e74705SXin Li// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result 5*67e74705SXin Li// rdar://15396636 6*67e74705SXin Li 7*67e74705SXin Li#ifndef NS_RETURNS_INNER_POINTER // defined in iOS 6 for sure 8*67e74705SXin Li#define NS_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer)) 9*67e74705SXin Li#endif 10*67e74705SXin Li 11*67e74705SXin Li#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin") 12*67e74705SXin Li 13*67e74705SXin Li#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end") 14*67e74705SXin Li 15*67e74705SXin Li#if __has_feature(attribute_ns_returns_retained) 16*67e74705SXin Li#define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) 17*67e74705SXin Li#endif 18*67e74705SXin Li#if __has_feature(attribute_cf_returns_retained) 19*67e74705SXin Li#define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) 20*67e74705SXin Li#endif 21*67e74705SXin Li#if __has_feature(attribute_ns_returns_not_retained) 22*67e74705SXin Li#define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) 23*67e74705SXin Li#endif 24*67e74705SXin Li#if __has_feature(attribute_cf_returns_not_retained) 25*67e74705SXin Li#define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) 26*67e74705SXin Li#endif 27*67e74705SXin Li#if __has_feature(attribute_ns_consumes_self) 28*67e74705SXin Li#define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) 29*67e74705SXin Li#endif 30*67e74705SXin Li#if __has_feature(attribute_ns_consumed) 31*67e74705SXin Li#define NS_CONSUMED __attribute__((ns_consumed)) 32*67e74705SXin Li#endif 33*67e74705SXin Li#if __has_feature(attribute_cf_consumed) 34*67e74705SXin Li#define CF_CONSUMED __attribute__((cf_consumed)) 35*67e74705SXin Li#endif 36*67e74705SXin Li#if __has_attribute(ns_returns_autoreleased) 37*67e74705SXin Li#define NS_RETURNS_AUTORELEASED __attribute__((ns_returns_autoreleased)) 38*67e74705SXin Li#endif 39*67e74705SXin Li 40*67e74705SXin Li#define NS_AVAILABLE __attribute__((availability(macosx,introduced=10.0))) 41*67e74705SXin Li 42*67e74705SXin LiCF_IMPLICIT_BRIDGING_ENABLED 43*67e74705SXin Li 44*67e74705SXin Litypedef unsigned long CFTypeID; 45*67e74705SXin Litypedef unsigned long CFOptionFlags; 46*67e74705SXin Litypedef unsigned long CFHashCode; 47*67e74705SXin Li 48*67e74705SXin Litypedef signed long CFIndex; /*AnyObj*/ 49*67e74705SXin Litypedef const struct __CFArray * CFArrayRef; 50*67e74705SXin Litypedef struct { 51*67e74705SXin Li CFIndex location; 52*67e74705SXin Li CFIndex length; 53*67e74705SXin Li} CFRange; 54*67e74705SXin Li 55*67e74705SXin Litypedef void (*CFArrayApplierFunction)(const void *value, void *context); 56*67e74705SXin Li 57*67e74705SXin Litypedef enum CFComparisonResult : CFIndex CFComparisonResult; enum CFComparisonResult : CFIndex { 58*67e74705SXin Li kCFCompareLessThan = -1L, 59*67e74705SXin Li kCFCompareEqualTo = 0, 60*67e74705SXin Li kCFCompareGreaterThan = 1 61*67e74705SXin Li}; 62*67e74705SXin Li 63*67e74705SXin Li 64*67e74705SXin Litypedef CFComparisonResult (*CFComparatorFunction)(const void *val1, const void *val2, void *context); 65*67e74705SXin Li 66*67e74705SXin Litypedef struct __CFArray * CFMutableArrayRef; 67*67e74705SXin Li 68*67e74705SXin Litypedef const struct __CFAttributedString *CFAttributedStringRef; 69*67e74705SXin Litypedef struct __CFAttributedString *CFMutableAttributedStringRef; 70*67e74705SXin Li 71*67e74705SXin Litypedef const struct __CFAllocator * CFAllocatorRef; 72*67e74705SXin Li 73*67e74705SXin Litypedef const struct __CFString * CFStringRef; 74*67e74705SXin Litypedef struct __CFString * CFMutableStringRef; 75*67e74705SXin Li 76*67e74705SXin Litypedef const struct __CFDictionary * CFDictionaryRef; 77*67e74705SXin Litypedef struct __CFDictionary * CFMutableDictionaryRef; 78*67e74705SXin Li 79*67e74705SXin Litypedef struct CGImage *CGImageRef; 80*67e74705SXin Li 81*67e74705SXin Litypedef struct OpaqueJSValue* JSObjectRef; 82*67e74705SXin Li 83*67e74705SXin Litypedef JSObjectRef TTJSObjectRef; 84*67e74705SXin Litypedef unsigned int NSUInteger; 85*67e74705SXin Li 86*67e74705SXin LiCF_IMPLICIT_BRIDGING_DISABLED 87*67e74705SXin Li 88*67e74705SXin Li@interface I 89*67e74705SXin Li@property (nonatomic, readonly) void *ReturnsInnerPointer; 90*67e74705SXin Li@property (nonatomic, readonly) int *AlreadyReturnsInnerPointer NS_RETURNS_INNER_POINTER; 91*67e74705SXin Li@end 92*67e74705SXin Li 93*67e74705SXin Li@interface UIImage 94*67e74705SXin Li@property (nonatomic, readonly) CGImageRef CGImage CF_RETURNS_NOT_RETAINED; 95*67e74705SXin Li@end 96*67e74705SXin Li 97*67e74705SXin Li@interface NSData 98*67e74705SXin Li@property (nonatomic, readonly) void *bytes; 99*67e74705SXin Li@property (nonatomic, readonly) void **ptr_bytes __attribute__((availability(macosx,unavailable))); 100*67e74705SXin Li@end 101*67e74705SXin Li 102*67e74705SXin Li@interface NSMutableData 103*67e74705SXin Li@property (nonatomic, readonly) void *mutableBytes __attribute__((deprecated)) __attribute__((unavailable)); 104*67e74705SXin Li@end 105*67e74705SXin Li 106*67e74705SXin Li@interface JS 107*67e74705SXin Li@property (nonatomic, readonly) JSObjectRef JSObject; 108*67e74705SXin Li@property (nonatomic, readonly) TTJSObjectRef JSObject1; 109*67e74705SXin Li@property (nonatomic, readonly) JSObjectRef *JSObject2; 110*67e74705SXin Li@end 111*67e74705SXin Li 112*67e74705SXin Li// rdar://15044991 113*67e74705SXin Litypedef void *SecTrustRef; 114*67e74705SXin Li 115*67e74705SXin Li@interface NSURLProtectionSpace 116*67e74705SXin Li@property (readonly) SecTrustRef serverTrust NS_AVAILABLE; 117*67e74705SXin Li@property (nonatomic, readonly) void *FOO NS_AVAILABLE; 118*67e74705SXin Li@property (readonly) void * mitTrust NS_AVAILABLE; 119*67e74705SXin Li 120*67e74705SXin Li@property (readonly) void * mittiTrust; 121*67e74705SXin Li 122*67e74705SXin Li@property (readonly) SecTrustRef XserverTrust; 123*67e74705SXin Li 124*67e74705SXin Li@property (nonatomic, readonly) SecTrustRef FOO1 NS_AVAILABLE; 125*67e74705SXin Li 126*67e74705SXin Li+ (const NSURLProtectionSpace *)ProtectionSpace; 127*67e74705SXin Li 128*67e74705SXin Li// pointer personality functions 129*67e74705SXin Li@property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item)); 130*67e74705SXin Li@end 131*67e74705SXin Li 132*67e74705SXin Li@interface MustNotMigrateToInnerPointer 133*67e74705SXin Li@property (nonatomic) void *nono; 134*67e74705SXin Li@end 135