1 // RUN: %clang_cc1 -triple arm64-windows -Wno-implicit-function-declaration -fms-compatibility -emit-llvm -o - %s \
2 // RUN: | FileCheck %s --check-prefix=CHECK-MSVC --check-prefix=CHECK-MSCOMPAT
4 // RUN: not %clang_cc1 -triple arm64-linux -Werror -S -o /dev/null %s 2>&1 \
5 // RUN: | FileCheck %s -check-prefix CHECK-LINUX
7 // RUN: %clang_cc1 -triple arm64-darwin -Wno-implicit-function-declaration -fms-compatibility -emit-llvm -o - %s \
8 // RUN: | FileCheck %s -check-prefix CHECK-MSCOMPAT
10 long test_InterlockedAdd(long volatile *Addend
, long Value
) {
11 return _InterlockedAdd(Addend
, Value
);
14 long test_InterlockedAdd_constant(long volatile *Addend
) {
15 return _InterlockedAdd(Addend
, -1);
18 // CHECK-LABEL: define {{.*}} i32 @test_InterlockedAdd(ptr %Addend, i32 %Value) {{.*}} {
19 // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i32 %2 seq_cst, align 4
20 // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i32 %[[OLDVAL:[0-9]+]], %2
21 // CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
22 // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd'
24 void check__dmb(void) {
28 // CHECK-MSVC: @llvm.aarch64.dmb(i32 0)
29 // CHECK-LINUX: error: call to undeclared function '__dmb'
31 void check__dsb(void) {
35 // CHECK-MSVC: @llvm.aarch64.dsb(i32 0)
36 // CHECK-LINUX: error: call to undeclared function '__dsb'
38 void check__isb(void) {
42 // CHECK-MSVC: @llvm.aarch64.isb(i32 0)
43 // CHECK-LINUX: error: call to undeclared function '__isb'
45 void check__yield(void) {
49 // CHECK-MSVC: @llvm.aarch64.hint(i32 1)
50 // CHECK-LINUX: error: call to undeclared function '__yield'
52 void check__wfe(void) {
56 // CHECK-MSVC: @llvm.aarch64.hint(i32 2)
57 // CHECK-LINUX: error: call to undeclared function '__wfe'
59 void check__wfi(void) {
63 // CHECK-MSVC: @llvm.aarch64.hint(i32 3)
64 // CHECK-LINUX: error: call to undeclared function '__wfi'
66 void check__sev(void) {
70 // CHECK-MSVC: @llvm.aarch64.hint(i32 4)
71 // CHECK-LINUX: error: call to undeclared function '__sev'
73 void check__sevl(void) {
77 // CHECK-MSVC: @llvm.aarch64.hint(i32 5)
78 // CHECK-LINUX: error: call to undeclared function '__sevl'
80 void check_ReadWriteBarrier(void) {
84 // CHECK-MSVC: fence syncscope("singlethread")
85 // CHECK-LINUX: error: call to undeclared function '_ReadWriteBarrier'
87 long long check_mulh(long long a
, long long b
) {
91 // CHECK-MSVC: %[[ARG1:.*]] = sext i64 {{.*}} to i128
92 // CHECK-MSVC: %[[ARG2:.*]] = sext i64 {{.*}} to i128
93 // CHECK-MSVC: %[[PROD:.*]] = mul nsw i128 %[[ARG1]], %[[ARG2]]
94 // CHECK-MSVC: %[[HIGH:.*]] = ashr i128 %[[PROD]], 64
95 // CHECK-MSVC: %[[RES:.*]] = trunc i128 %[[HIGH]] to i64
96 // CHECK-LINUX: error: call to undeclared function '__mulh'
98 unsigned long long check_umulh(unsigned long long a
, unsigned long long b
) {
102 // CHECK-MSVC: %[[ARG1:.*]] = zext i64 {{.*}} to i128
103 // CHECK-MSVC: %[[ARG2:.*]] = zext i64 {{.*}} to i128
104 // CHECK-MSVC: %[[PROD:.*]] = mul nuw i128 %[[ARG1]], %[[ARG2]]
105 // CHECK-MSVC: %[[HIGH:.*]] = lshr i128 %[[PROD]], 64
106 // CHECK-MSVC: %[[RES:.*]] = trunc i128 %[[HIGH]] to i64
107 // CHECK-LINUX: error: call to undeclared function '__umulh'
109 void check__break() {
113 // CHECK-MSVC: call void @llvm.aarch64.break(i32 0)
114 // CHECK-LINUX: error: call to undeclared function '__break'
116 unsigned __int64
check__getReg(void) {
117 unsigned volatile __int64 reg
;
123 // CHECK-MSCOMPAT: call i64 @llvm.read_register.i64(metadata ![[MD2:.*]])
124 // CHECK-MSCOMPAT: call i64 @llvm.read_register.i64(metadata ![[MD3:.*]])
133 void check__writex18byte(unsigned char data
, unsigned LONG offset
) {
135 void check__writex18byte(unsigned LONG offset
, unsigned char data
) {
137 __writex18byte(offset
, data
);
140 // CHECK-MSCOMPAT: %[[DATA_ADDR:.*]] = alloca i8, align 1
141 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
142 // CHECK-MSCOMPAT: store i8 %data, ptr %[[DATA_ADDR]], align 1
143 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
144 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
145 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
146 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
147 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
148 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
149 // CHECK-MSCOMPAT: %[[DATA:.*]] = load i8, ptr %[[DATA_ADDR]], align 1
150 // CHECK-MSCOMPAT: store i8 %[[DATA]], ptr %[[PTR]], align 1
153 void check__writex18word(unsigned short data
, unsigned LONG offset
) {
155 void check__writex18word(unsigned LONG offset
, unsigned short data
) {
157 __writex18word(offset
, data
);
160 // CHECK-MSCOMPAT: %[[DATA_ADDR:.*]] = alloca i16, align 2
161 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
162 // CHECK-MSCOMPAT: store i16 %data, ptr %[[DATA_ADDR]], align 2
163 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
164 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
165 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
166 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
167 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
168 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
169 // CHECK-MSCOMPAT: %[[DATA:.*]] = load i16, ptr %[[DATA_ADDR]], align 2
170 // CHECK-MSCOMPAT: store i16 %[[DATA]], ptr %[[PTR]], align 1
173 void check__writex18dword(unsigned LONG data
, unsigned LONG offset
) {
175 void check__writex18dword(unsigned LONG offset
, unsigned LONG data
) {
177 __writex18dword(offset
, data
);
180 // CHECK-MSCOMPAT: %[[DATA_ADDR:.*]] = alloca i32, align 4
181 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
182 // CHECK-MSCOMPAT: store i32 %data, ptr %[[DATA_ADDR]], align 4
183 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
184 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
185 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
186 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
187 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
188 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
189 // CHECK-MSCOMPAT: %[[DATA:.*]] = load i32, ptr %[[DATA_ADDR]], align 4
190 // CHECK-MSCOMPAT: store i32 %[[DATA]], ptr %[[PTR]], align 1
193 void check__writex18qword(unsigned __int64 data
, unsigned LONG offset
) {
195 void check__writex18qword(unsigned LONG offset
, unsigned __int64 data
) {
197 __writex18qword(offset
, data
);
200 // CHECK-MSCOMPAT: %[[DATA_ADDR:.*]] = alloca i64, align 8
201 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
202 // CHECK-MSCOMPAT: store i64 %data, ptr %[[DATA_ADDR]], align 8
203 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
204 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
205 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
206 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
207 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
208 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
209 // CHECK-MSCOMPAT: %[[DATA:.*]] = load i64, ptr %[[DATA_ADDR]], align 8
210 // CHECK-MSCOMPAT: store i64 %[[DATA]], ptr %[[PTR]], align 1
212 unsigned char check__readx18byte(unsigned LONG offset
) {
213 return __readx18byte(offset
);
216 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
217 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
218 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
219 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
220 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
221 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
222 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
223 // CHECK-MSCOMPAT: %[[RETVAL:.*]] = load i8, ptr %[[PTR]], align 1
224 // CHECK-MSCOMPAT: ret i8 %[[RETVAL]]
226 unsigned short check__readx18word(unsigned LONG offset
) {
227 return __readx18word(offset
);
230 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
231 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
232 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
233 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
234 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
235 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
236 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
237 // CHECK-MSCOMPAT: %[[RETVAL:.*]] = load i16, ptr %[[PTR]], align 1
238 // CHECK-MSCOMPAT: ret i16 %[[RETVAL]]
240 unsigned LONG
check__readx18dword(unsigned LONG offset
) {
241 return __readx18dword(offset
);
244 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
245 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
246 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
247 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
248 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
249 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
250 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
251 // CHECK-MSCOMPAT: %[[RETVAL:.*]] = load i32, ptr %[[PTR]], align 1
252 // CHECK-MSCOMPAT: ret i32 %[[RETVAL]]
254 unsigned __int64
check__readx18qword(unsigned LONG offset
) {
255 return __readx18qword(offset
);
258 // CHECK-MSCOMPAT: %[[OFFSET_ADDR:.*]] = alloca i32, align 4
259 // CHECK-MSCOMPAT: store i32 %offset, ptr %[[OFFSET_ADDR]], align 4
260 // CHECK-MSCOMPAT: %[[X18:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2]])
261 // CHECK-MSCOMPAT: %[[X18_AS_PTR:.*]] = inttoptr i64 %[[X18]] to ptr
262 // CHECK-MSCOMPAT: %[[OFFSET:.*]] = load i32, ptr %[[OFFSET_ADDR]], align 4
263 // CHECK-MSCOMPAT: %[[ZEXT_OFFSET:.*]] = zext i32 %[[OFFSET]] to i64
264 // CHECK-MSCOMPAT: %[[PTR:.*]] = getelementptr i8, ptr %[[X18_AS_PTR]], i64 %[[ZEXT_OFFSET]]
265 // CHECK-MSCOMPAT: %[[RETVAL:.*]] = load i64, ptr %[[PTR]], align 1
266 // CHECK-MSCOMPAT: ret i64 %[[RETVAL]]
268 double check__CopyDoubleFromInt64(__int64 arg1
) {
269 return _CopyDoubleFromInt64(arg1
);
272 // CHECK-MSCOMPAT: %[[ARG:.*]].addr = alloca i64, align 8
273 // CHECK-MSCOMPAT: store i64 %[[ARG]], ptr %[[ARG]].addr, align 8
274 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i64, ptr %[[ARG]].addr, align 8
275 // CHECK-MSCOMPAT: %[[VAR1:.*]] = bitcast i64 %[[VAR0]] to double
276 // CHECK-MSCOMPAT: ret double %[[VAR1]]
277 // CHECK-LINUX: error: call to undeclared function '_CopyDoubleFromInt64'
279 float check__CopyFloatFromInt32(__int32 arg1
) {
280 return _CopyFloatFromInt32(arg1
);
283 // CHECK-MSCOMPAT: %[[ARG:.*]].addr = alloca i32, align 4
284 // CHECK-MSCOMPAT: store i32 %[[ARG]], ptr %[[ARG]].addr, align 4
285 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i32, ptr %[[ARG]].addr, align 4
286 // CHECK-MSCOMPAT: %[[VAR1:.*]] = bitcast i32 %[[VAR0]] to float
287 // CHECK-MSCOMPAT: ret float %[[VAR1]]
288 // CHECK-LINUX: error: call to undeclared function '_CopyFloatFromInt32'
290 __int32
check__CopyInt32FromFloat(float arg1
) {
291 return _CopyInt32FromFloat(arg1
);
294 // CHECK-MSCOMPAT: %[[ARG:.*]].addr = alloca float, align 4
295 // CHECK-MSCOMPAT: store float %[[ARG]], ptr %[[ARG]].addr, align 4
296 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load float, ptr %[[ARG]].addr, align 4
297 // CHECK-MSCOMPAT: %[[VAR1:.*]] = bitcast float %[[VAR0]] to i32
298 // CHECK-MSCOMPAT: ret i32 %[[VAR1]]
299 // CHECK-LINUX: error: call to undeclared function '_CopyInt32FromFloat'
301 __int64
check__CopyInt64FromDouble(double arg1
) {
302 return _CopyInt64FromDouble(arg1
);
305 // CHECK-MSCOMPAT: %[[ARG:.*]].addr = alloca double, align 8
306 // CHECK-MSCOMPAT: store double %[[ARG]], ptr %[[ARG]].addr, align 8
307 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load double, ptr %[[ARG]].addr, align 8
308 // CHECK-MSCOMPAT: %[[VAR1:.*]] = bitcast double %[[VAR0]] to i64
309 // CHECK-MSCOMPAT: ret i64 %[[VAR1]]
310 // CHECK-LINUX: error: call to undeclared function '_CopyInt64FromDouble'
312 unsigned int check__CountLeadingOnes(unsigned LONG arg1
) {
313 return _CountLeadingOnes(arg1
);
316 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i32, align 4
317 // CHECK-MSCOMPAT: store i32 %[[ARG1]], ptr %[[ARG1]].addr, align 4
318 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i32, ptr %[[ARG1]].addr, align 4
319 // CHECK-MSCOMPAT: %[[VAR1:.*]] = xor i32 %[[VAR0]], -1
320 // CHECK-MSCOMPAT: %[[VAR2:.*]] = call i32 @llvm.ctlz.i32(i32 %1, i1 false)
321 // CHECK-MSCOMPAT: ret i32 %[[VAR2]]
322 // CHECK-LINUX: error: call to undeclared function '_CountLeadingOnes'
324 unsigned int check__CountLeadingOnes64(unsigned __int64 arg1
) {
325 return _CountLeadingOnes64(arg1
);
328 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i64, align 8
329 // CHECK-MSCOMPAT: store i64 %[[ARG1]], ptr %[[ARG1]].addr, align 8
330 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i64, ptr %[[ARG1]].addr, align 8
331 // CHECK-MSCOMPAT: %[[VAR1:.*]] = xor i64 %[[VAR0]], -1
332 // CHECK-MSCOMPAT: %[[VAR2:.*]] = call i64 @llvm.ctlz.i64(i64 %1, i1 false)
333 // CHECK-MSCOMPAT: %[[VAR3:.*]] = trunc i64 %2 to i32
334 // CHECK-MSCOMPAT: ret i32 %[[VAR3]]
335 // CHECK-LINUX: error: call to undeclared function '_CountLeadingOnes64'
337 unsigned int check__CountLeadingSigns(__int32 arg1
) {
338 return _CountLeadingSigns(arg1
);
341 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i32, align 4
342 // CHECK-MSCOMPAT: store i32 %[[ARG1]], ptr %[[ARG1]].addr, align 4
343 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i32, ptr %[[ARG1]].addr, align 4
344 // CHECK-MSCOMPAT: %[[CLS:.*]] = call i32 @llvm.aarch64.cls(i32 %[[VAR0]])
345 // CHECK-MSCOMPAT: ret i32 %[[CLS]]
346 // CHECK-LINUX: error: call to undeclared function '_CountLeadingSigns'
348 unsigned int check__CountLeadingSigns64(__int64 arg1
) {
349 return _CountLeadingSigns64(arg1
);
352 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i64, align 8
353 // CHECK-MSCOMPAT: store i64 %[[ARG1]], ptr %[[ARG1]].addr, align 8
354 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i64, ptr %[[ARG1]].addr, align 8
355 // CHECK-MSCOMPAT: %[[CLS:.*]] = call i32 @llvm.aarch64.cls64(i64 %[[VAR0]])
356 // CHECK-MSCOMPAT: ret i32 %[[CLS]]
357 // CHECK-LINUX: error: call to undeclared function '_CountLeadingSigns64'
359 unsigned int check__CountLeadingZeros(__int32 arg1
) {
360 return _CountLeadingZeros(arg1
);
363 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i32, align 4
364 // CHECK-MSCOMPAT: store i32 %[[ARG1]], ptr %[[ARG1]].addr, align 4
365 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i32, ptr %[[ARG1]].addr, align 4
366 // CHECK-MSCOMPAT: %[[VAR1:.*]] = call i32 @llvm.ctlz.i32(i32 %[[VAR0]], i1 false)
367 // CHECK-MSCOMPAT: ret i32 %[[VAR1]]
368 // CHECK-LINUX: error: call to undeclared function '_CountLeadingZeros'
370 unsigned int check__CountLeadingZeros64(__int64 arg1
) {
371 return _CountLeadingZeros64(arg1
);
374 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i64, align 8
375 // CHECK-MSCOMPAT: store i64 %[[ARG1]], ptr %[[ARG1]].addr, align 8
376 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i64, ptr %[[ARG1]].addr, align 8
377 // CHECK-MSCOMPAT: %[[VAR1:.*]] = call i64 @llvm.ctlz.i64(i64 %[[VAR0]], i1 false)
378 // CHECK-MSCOMPAT: %[[VAR2:.*]] = trunc i64 %[[VAR1]] to i32
379 // CHECK-MSCOMPAT: ret i32 %[[VAR2]]
380 // CHECK-LINUX: error: call to undeclared function '_CountLeadingZeros64'
382 unsigned int check_CountOneBits(unsigned LONG arg1
) {
383 return _CountOneBits(arg1
);
386 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i32, align 4
387 // CHECK-MSCOMPAT: store i32 %[[ARG1]], ptr %[[ARG1]].addr, align 4
388 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i32, ptr %[[ARG1]].addr, align 4
389 // CHECK-MSCOMPAT: %[[VAR1:.*]] = call i32 @llvm.ctpop.i32(i32 %0)
390 // CHECK-MSCOMPAT: ret i32 %[[VAR1]]
391 // CHECK-LINUX: error: call to undeclared function '_CountOneBits'
393 unsigned int check_CountOneBits64(unsigned __int64 arg1
) {
394 return _CountOneBits64(arg1
);
397 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca i64, align 8
398 // CHECK-MSCOMPAT: store i64 %[[ARG1]], ptr %[[ARG1]].addr, align 8
399 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load i64, ptr %[[ARG1]].addr, align 8
400 // CHECK-MSCOMPAT: %[[VAR1:.*]] = call i64 @llvm.ctpop.i64(i64 %0)
401 // CHECK-MSCOMPAT: %[[VAR2:.*]] = trunc i64 %1 to i32
402 // CHECK-MSCOMPAT: ret i32 %[[VAR2]]
403 // CHECK-LINUX: error: call to undeclared function '_CountOneBits64'
405 void check__prefetch(void *arg1
) {
406 return __prefetch(arg1
);
409 // CHECK-MSCOMPAT: %[[ARG1:.*]].addr = alloca ptr, align 8
410 // CHECK-MSCOMPAT: store ptr %[[ARG1]], ptr %[[ARG1]].addr, align 8
411 // CHECK-MSCOMPAT: %[[VAR0:.*]] = load ptr, ptr %[[ARG1]].addr, align 8
412 // CHECK-MSCOMPAT: call void @llvm.prefetch.p0(ptr %[[VAR0]], i32 0, i32 3, i32 1)
413 // CHECK-MSCOMPAT: ret void
416 // CHECK-MSCOMPAT: ![[MD2]] = !{!"x18"}
417 // CHECK-MSCOMPAT: ![[MD3]] = !{!"sp"}