[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / clang / test / SemaObjC / objc-mixed-bridge-attribute.m
blob83fb4d3cc497eb46191fe5b614ec60ef7dffd237
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2 // expected-no-diagnostics
3 // rdar://17238954
5 typedef const struct __attribute__((objc_bridge(NSAttributedString))) __CFAttributedString *CFAttributedStringRef;
7 typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __CFAttributedString *CFMutableAttributedStringRef;
9 @interface NSAttributedString
10 @end
12 @interface NSMutableAttributedString
13 @end
15 struct __CFAttributedString {
18 void Test1(CFAttributedStringRef attrStr, CFMutableAttributedStringRef mutable_attrStr)
20   id x = (NSAttributedString *) attrStr;
21   id x1 =(NSAttributedString *) mutable_attrStr;
22   id x2 = (NSMutableAttributedString *) attrStr;
23   id x3 = (NSMutableAttributedString *) mutable_attrStr;
26 void Test2(NSAttributedString *ns_attrStr, NSMutableAttributedString *ns_mutable_attr_Str) {
27   CFAttributedStringRef cfsr = (CFAttributedStringRef) ns_attrStr;
28   CFMutableAttributedStringRef cfsr1 = (CFMutableAttributedStringRef) ns_attrStr;
29   CFAttributedStringRef cfsr2 = (CFAttributedStringRef) ns_mutable_attr_Str;
30   CFMutableAttributedStringRef cfsr3 = (CFMutableAttributedStringRef) ns_mutable_attr_Str;
33 // Tests with no definition declaration for struct __NDCFAttributedString.
34 typedef const struct __attribute__((objc_bridge(NSAttributedString))) __NDCFAttributedString *NDCFAttributedStringRef;
36 typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __NDCFAttributedString *NDCFMutableAttributedStringRef;
38 void Test3(NDCFAttributedStringRef attrStr, NDCFMutableAttributedStringRef mutable_attrStr)
40   id x = (NSAttributedString *) attrStr;
41   id x1 =(NSAttributedString *) mutable_attrStr;
42   id x2 = (NSMutableAttributedString *) attrStr;
43   id x3 = (NSMutableAttributedString *) mutable_attrStr;
46 void Test4(NSAttributedString *ns_attrStr, NSMutableAttributedString *ns_mutable_attr_Str) {
47   NDCFAttributedStringRef cfsr = (NDCFAttributedStringRef) ns_attrStr;
48   NDCFMutableAttributedStringRef cfsr1 = (NDCFMutableAttributedStringRef) ns_attrStr;
49   NDCFAttributedStringRef cfsr2 = (NDCFAttributedStringRef) ns_mutable_attr_Str;
50   NDCFMutableAttributedStringRef cfsr3 = (NDCFMutableAttributedStringRef) ns_mutable_attr_Str;