1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2 // expected-no-diagnostics
4 typedef const struct __attribute__((objc_bridge(NSAttributedString))) __CFAttributedString *CFAttributedStringRef;
6 typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __CFAttributedString *CFMutableAttributedStringRef;
8 @interface NSAttributedString
11 @interface NSMutableAttributedString
14 struct __CFAttributedString {
17 void Test1(CFAttributedStringRef attrStr, CFMutableAttributedStringRef mutable_attrStr)
19 id x = (NSAttributedString *) attrStr;
20 id x1 =(NSAttributedString *) mutable_attrStr;
21 id x2 = (NSMutableAttributedString *) attrStr;
22 id x3 = (NSMutableAttributedString *) mutable_attrStr;
25 void Test2(NSAttributedString *ns_attrStr, NSMutableAttributedString *ns_mutable_attr_Str) {
26 CFAttributedStringRef cfsr = (CFAttributedStringRef) ns_attrStr;
27 CFMutableAttributedStringRef cfsr1 = (CFMutableAttributedStringRef) ns_attrStr;
28 CFAttributedStringRef cfsr2 = (CFAttributedStringRef) ns_mutable_attr_Str;
29 CFMutableAttributedStringRef cfsr3 = (CFMutableAttributedStringRef) ns_mutable_attr_Str;
32 // Tests with no definition declaration for struct __NDCFAttributedString.
33 typedef const struct __attribute__((objc_bridge(NSAttributedString))) __NDCFAttributedString *NDCFAttributedStringRef;
35 typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __NDCFAttributedString *NDCFMutableAttributedStringRef;
37 void Test3(NDCFAttributedStringRef attrStr, NDCFMutableAttributedStringRef mutable_attrStr)
39 id x = (NSAttributedString *) attrStr;
40 id x1 =(NSAttributedString *) mutable_attrStr;
41 id x2 = (NSMutableAttributedString *) attrStr;
42 id x3 = (NSMutableAttributedString *) mutable_attrStr;
45 void Test4(NSAttributedString *ns_attrStr, NSMutableAttributedString *ns_mutable_attr_Str) {
46 NDCFAttributedStringRef cfsr = (NDCFAttributedStringRef) ns_attrStr;
47 NDCFMutableAttributedStringRef cfsr1 = (NDCFMutableAttributedStringRef) ns_attrStr;
48 NDCFAttributedStringRef cfsr2 = (NDCFAttributedStringRef) ns_mutable_attr_Str;
49 NDCFMutableAttributedStringRef cfsr3 = (NDCFMutableAttributedStringRef) ns_mutable_attr_Str;