blob: 9a3e410c47d80a60f06f01d3543dbf0f17b36eb4 [file] [log] [blame]
Albert Gutowskia0ff5f02016-10-04 22:29:49 +00001// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s -fms-extensions
2// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -verify %s -fms-extensions
Albert Gutowski5eb95c42016-09-14 21:19:43 +00003
4void f() {
Albert Gutowskia0ff5f02016-10-04 22:29:49 +00005 (void)_byteswap_ushort(42); // expected-warning{{implicitly declaring library function '_byteswap_ushort'}} \
Albert Gutowski5eb95c42016-09-14 21:19:43 +00006 // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_ushort'}}
Albert Gutowskia0ff5f02016-10-04 22:29:49 +00007 (void)_byteswap_uint64(42LL); // expected-warning{{implicitly declaring library function '_byteswap_uint64'}} \
Albert Gutowski5eb95c42016-09-14 21:19:43 +00008 // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_uint64'}}
9}
10
11void _byteswap_ulong(); // expected-warning{{incompatible redeclaration of library function '_byteswap_ulong'}} \
12// expected-note{{'_byteswap_ulong' is a builtin}}
13
14unsigned short _byteswap_ushort(unsigned short);
15unsigned long long _byteswap_uint64(unsigned long long);
16
17void g() {
18 (void)_byteswap_ushort(42);
19 (void)_byteswap_uint64(42LL);
20}
Albert Gutowskia0ff5f02016-10-04 22:29:49 +000021
22#if defined(__x86_64__)
23void h() {
24 (void)__mulh(21, 2); // expected-warning{{implicitly declaring library function '__mulh'}} \
25 // expected-note{{include the header <intrin.h> or explicitly provide a declaration for '__mulh'}}
26 (void)__umulh(21, 2); // expected-warning{{implicitly declaring library function '__umulh'}} \
27 // expected-note{{include the header <intrin.h> or explicitly provide a declaration for '__umulh'}}
28}
29
30long long __mulh(long long, long long);
31unsigned long long __umulh(unsigned long long, unsigned long long);
32
33void i() {
34 (void)__mulh(21, 2);
35 (void)__umulh(21, 2);
36}
37#endif
38
39#if defined(i386)
40void h() {
41 (void)__mulh(21LL, 2LL); // expected-warning{{implicit declaration of function '__mulh' is invalid}}
42 (void)__umulh(21ULL, 2ULL); // expected-warning{{implicit declaration of function '__umulh' is invalid}}
43}
44#endif