blob: 4e1e293efbac77f9590534fd22881fbed1bbc20c [file] [log] [blame]
John McCall8f0e8d22011-06-15 23:25:17 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
Argyrios Kyrtzidiseaed19e2011-06-16 00:53:46 +00002// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -x objective-c %s > %t
John McCall8f0e8d22011-06-15 23:25:17 +00003// RUN: diff %t %s.result
4
5#include "Common.h"
6
7@interface NSString : NSObject
8@end
9
10typedef const struct __CFString * CFStringRef;
11extern const CFStringRef kUTTypePlainText;
12extern const CFStringRef kUTTypeRTF;
13
14typedef const struct __CFAllocator * CFAllocatorRef;
15typedef const struct __CFUUID * CFUUIDRef;
16
17extern const CFAllocatorRef kCFAllocatorDefault;
18
19extern CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
20
21void 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
John McCall8f0e8d22011-06-15 23:25:17 +000027 CFUUIDRef _uuid;
28 NSString *_uuidString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
29 _uuidString = [(NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid) autorelease];
30}
Argyrios Kyrtzidis8e2ce7f2011-06-20 23:39:20 +000031
32@implementation NSString (StrExt)
33- (NSString *)stringEscapedAsURI {
34 CFStringRef str = (CFStringRef)self;
35 CFStringRef str2 = self;
36 return self;
37}
38@end