forked from OSchip/llvm-project
33 lines
1.0 KiB
Mathematica
33 lines
1.0 KiB
Mathematica
![]() |
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
|
||
|
// RUN: arcmt-test --args -arch x86_64 %s > %t
|
||
|
// RUN: diff %t %s.result
|
||
|
|
||
|
#include "Common.h"
|
||
|
|
||
|
@interface NSString : NSObject
|
||
|
@end
|
||
|
|
||
|
typedef const struct __CFString * CFStringRef;
|
||
|
extern const CFStringRef kUTTypePlainText;
|
||
|
extern const CFStringRef kUTTypeRTF;
|
||
|
|
||
|
typedef const struct __CFAllocator * CFAllocatorRef;
|
||
|
typedef const struct __CFUUID * CFUUIDRef;
|
||
|
|
||
|
extern const CFAllocatorRef kCFAllocatorDefault;
|
||
|
|
||
|
extern CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
|
||
|
|
||
|
void f(BOOL b, id p) {
|
||
|
NSString *str = (NSString *)kUTTypePlainText;
|
||
|
str = b ? kUTTypeRTF : kUTTypePlainText;
|
||
|
str = (NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
|
||
|
str = (NSString *)p; // no change.
|
||
|
|
||
|
// FIXME: Add objc -> c examples that we can handle.
|
||
|
|
||
|
CFUUIDRef _uuid;
|
||
|
NSString *_uuidString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
|
||
|
_uuidString = [(NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid) autorelease];
|
||
|
}
|