aboutsummaryrefslogtreecommitdiff
path: root/test/ARCMT/nonobjc-to-objc-cast.m.result
diff options
context:
space:
mode:
Diffstat (limited to 'test/ARCMT/nonobjc-to-objc-cast.m.result')
-rw-r--r--test/ARCMT/nonobjc-to-objc-cast.m.result38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/ARCMT/nonobjc-to-objc-cast.m.result b/test/ARCMT/nonobjc-to-objc-cast.m.result
new file mode 100644
index 000000000000..53dde7553d6d
--- /dev/null
+++ b/test/ARCMT/nonobjc-to-objc-cast.m.result
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -x objective-c %s.result
+// RUN: arcmt-test --args -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fsyntax-only -x objective-c %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 = (__bridge NSString *)kUTTypePlainText;
+ str = (__bridge NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
+ str = (__bridge NSString *)(b ? kUTTypeRTF : kUTTypePlainText);
+ str = (NSString *)p; // no change.
+
+ CFUUIDRef _uuid;
+ NSString *_uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
+ _uuidString = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, _uuid);
+}
+
+@implementation NSString (StrExt)
+- (NSString *)stringEscapedAsURI {
+ CFStringRef str = (__bridge CFStringRef)self;
+ CFStringRef str2 = (__bridge CFStringRef)(self);
+ return self;
+}
+@end