blob: f7127b71927b48355e52bf39bcaef4013482ba1d [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 = (__bridge NSString *)kUTTypePlainText;
23 str = (__bridge NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
24 str = (__bridge NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
25 str = (NSString *)p; // no change.
26
27 // FIXME: Add objc -> c examples that we can handle.
28
29 CFUUIDRef _uuid;
30 NSString *_uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
31 _uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
32}