1 // RUN: %clang_cc1 -triple thumbv7-windows-msvc -fdeclspec -std=c++11 -fobjc-runtime=ios-6.0 -o - -emit-llvm %s | FileCheck %s
6 // CHECK: @"?kid@@3PAUobjc_object@@A" = dso_local global
9 // CHECK: @"?klass@@3PAUobjc_class@@A" = dso_local global
12 // CHECK: @"?kI@@3PAUI@@A" = dso_local global
15 // CHECK-LABEL: "?f@@YAXPAUI@@@Z"
18 // CHECK-LABEL: "?f@@YAXPBUI@@@Z"
21 // CHECK-LABEL: "?f@@YAXAAUI@@@Z"
24 // CHECK-LABEL: "?f@@YAXABUI@@@Z"
27 // CHECK-LABEL: "?f@@YAX$$QBUI@@@Z"
30 // CHECK-LABEL: "?g@@YAXPAUobjc_object@@@Z"
33 // CHECK-LABEL: "?g@@YAXAAPAUobjc_object@@@Z"
36 // CHECK-LABEL: "?g@@YAXABQAUobjc_object@@@Z"
39 // CHECK-LABEL: "?g@@YAX$$QAPAUobjc_object@@@Z"
42 // CHECK-LABEL: "?h@@YAXPAUobjc_class@@@Z"
45 // CHECK-LABEL: "?h@@YAXAAPAUobjc_class@@@Z"
47 void h(const Class &) {}
48 // CHECK-LABEL: "?h@@YAXABQAUobjc_class@@@Z"
51 // CHECK-LABEL: "?h@@YAX$$QAPAUobjc_class@@@Z"
53 I *i() { return nullptr; }
54 // CHECK-LABEL: "?i@@YAPAUI@@XZ"
56 const I *j() { return nullptr; }
57 // CHECK-LABEL: "?j@@YAPBUI@@XZ"
59 I &k() { return *kI; }
60 // CHECK-LABEL: "?k@@YAAAUI@@XZ"
62 const I &l() { return *kI; }
63 // CHECK-LABEL: "?l@@YAABUI@@XZ"
66 // CHECK-LABEL: "?m@@YAXQAUobjc_object@@@Z"
69 // CHECK-LABEL: "?m@@YAXPBUI@@@Z"
72 // CHECK-LABEL: "?n@@YAXPAUobjc_selector@@@Z"
75 // CHECK-LABEL: "?n@@YAXPAPAUobjc_selector@@@Z"
77 void n(const SEL *) {}
78 // CHECK-LABEL: "?n@@YAXPBQAUobjc_selector@@@Z"
81 // CHECK-LABEL: "?n@@YAXAAPAUobjc_selector@@@Z"
83 void n(const SEL &) {}
84 // CHECK-LABEL: "?n@@YAXABQAUobjc_selector@@@Z"
87 // CHECK-LABEL: "?n@@YAX$$QAPAUobjc_selector@@@Z"
89 struct __declspec(dllexport) s {
90 struct s &operator=(const struct s &) = delete;
93 // CHECK-LABEL: "?m@s@@QAAXPAUI@@@Z"
96 // CHECK-LABEL: "?m@s@@QAAXPBUI@@@Z"
99 // CHECK-LABEL: "?m@s@@QAAXAAUI@@@Z"
102 // CHECK-LABEL: "?m@s@@QAAXABUI@@@Z"
105 // CHECK-LABEL: "?m@s@@QAAX$$QAUI@@@Z"
107 void m(const I &&) {}
108 // CHECK-LABEL: "?m@s@@QAAX$$QBUI@@@Z"
111 // CHECK-LABEL: "?m@s@@QAAXPAUobjc_object@@@Z"
114 // CHECK-LABEL: "?m@s@@QAAXAAPAUobjc_object@@@Z"
117 // CHECK-LABEL: "?m@s@@QAAX$$QAPAUobjc_object@@@Z"
119 void m(const id &) {}
120 // CHECK-LABEL: "?m@s@@QAAXABQAUobjc_object@@@Z"
122 void m(const id &&) {}
123 // CHECK-LABEL: "?m@s@@QAAX$$QBQAUobjc_object@@@Z"
126 // CHECK-LABEL: "?m@s@@QAAXPAPAUobjc_class@@@Z"
128 void m(const Class *) {}
129 // CHECK-LABEL: "?m@s@@QAAXPBQAUobjc_class@@@Z"
132 // CHECK-LABEL: "?m@s@@QAAXPAUobjc_class@@@Z"
135 // CHECK-LABEL: "?m@s@@QAAXAAPAUobjc_class@@@Z"
137 void m(const Class &) {}
138 // CHECK-LABEL: "?m@s@@QAAXABQAUobjc_class@@@Z"
141 // CHECK-LABEL: "?m@s@@QAAX$$QAPAUobjc_class@@@Z"
143 void m(const Class &&) {}
144 // CHECK-LABEL: "?m@s@@QAAX$$QBQAUobjc_class@@@Z"
147 // CHECK-LABEL: "?m@s@@QAAXPAUobjc_selector@@@Z"
150 // CHECK-LABEL: "?m@s@@QAAXPAPAUobjc_selector@@@Z"
152 void m(const SEL *) {}
153 // CHECK-LABEL: "?m@s@@QAAXPBQAUobjc_selector@@@Z"
156 // CHECK-LABEL: "?m@s@@QAAXAAPAUobjc_selector@@@Z"
158 void m(const SEL &) {}
159 // CHECK-LABEL: "?m@s@@QAAXABQAUobjc_selector@@@Z"
162 // CHECK-LABEL: "?m@s@@QAAX$$QAPAUobjc_selector@@@Z"
164 void m(const SEL &&) {}
165 // CHECK-LABEL: "?m@s@@QAAX$$QBQAUobjc_selector@@@Z"
168 template <typename T>
169 struct remove_pointer { typedef T type; };
171 template <typename T>
172 struct remove_pointer<T *> {
176 template <typename T>
181 template struct t<id>;
182 // CHECK-LABEL: "??0?$t@PAUobjc_object@@@@QAA@XZ"
184 template struct t<remove_pointer<id>::type>;
185 // CHECK-LABEL: "??0?$t@Uobjc_object@@@@QAA@XZ"
187 template struct t<SEL>;
188 // CHECK-LABEL: "??0?$t@PAUobjc_selector@@@@QAA@XZ"
190 template struct t<remove_pointer<SEL>::type>;
191 // CHECK-LABEL: "??0?$t@Uobjc_selector@@@@QAA@XZ"