Home | History | Annotate | Download | only in ARCMT
      1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
      2 // RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -x objective-c %s > %t
      3 // RUN: diff %t %s.result
      4 
      5 #include "Common.h"
      6 
      7 @interface NSString : NSObject
      8 @end
      9 
     10 typedef const struct __CFString * CFStringRef;
     11 extern const CFStringRef kUTTypePlainText;
     12 extern const CFStringRef kUTTypeRTF;
     13 
     14 typedef const struct __CFAllocator * CFAllocatorRef;
     15 typedef const struct __CFUUID * CFUUIDRef;
     16 
     17 extern const CFAllocatorRef kCFAllocatorDefault;
     18 
     19 extern CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
     20 
     21 void f(BOOL b, id p) {
     22   NSString *str = (NSString *)kUTTypePlainText;
     23   str = b ? kUTTypeRTF : kUTTypePlainText;
     24   str = (NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
     25   str = (NSString *)p; // no change.
     26 
     27   CFUUIDRef   _uuid;
     28   NSString *_uuidString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
     29   _uuidString = [(NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid) autorelease];
     30 }
     31 
     32 @implementation NSString (StrExt)
     33 - (NSString *)stringEscapedAsURI {
     34   CFStringRef str = (CFStringRef)self;
     35   CFStringRef str2 = self;
     36   return self;
     37 }
     38 @end
     39