Albert Gutowski | a0ff5f0 | 2016-10-04 22:29:49 +0000 | [diff] [blame] | 1 | // 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 Gutowski | 5eb95c4 | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 3 | |
| 4 | void f() { |
Albert Gutowski | a0ff5f0 | 2016-10-04 22:29:49 +0000 | [diff] [blame] | 5 | (void)_byteswap_ushort(42); // expected-warning{{implicitly declaring library function '_byteswap_ushort'}} \ |
Albert Gutowski | 5eb95c4 | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 6 | // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_ushort'}} |
Albert Gutowski | a0ff5f0 | 2016-10-04 22:29:49 +0000 | [diff] [blame] | 7 | (void)_byteswap_uint64(42LL); // expected-warning{{implicitly declaring library function '_byteswap_uint64'}} \ |
Albert Gutowski | 5eb95c4 | 2016-09-14 21:19:43 +0000 | [diff] [blame] | 8 | // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_uint64'}} |
| 9 | } |
| 10 | |
| 11 | void _byteswap_ulong(); // expected-warning{{incompatible redeclaration of library function '_byteswap_ulong'}} \ |
| 12 | // expected-note{{'_byteswap_ulong' is a builtin}} |
| 13 | |
| 14 | unsigned short _byteswap_ushort(unsigned short); |
| 15 | unsigned long long _byteswap_uint64(unsigned long long); |
| 16 | |
| 17 | void g() { |
| 18 | (void)_byteswap_ushort(42); |
| 19 | (void)_byteswap_uint64(42LL); |
| 20 | } |
Albert Gutowski | a0ff5f0 | 2016-10-04 22:29:49 +0000 | [diff] [blame] | 21 | |
| 22 | #if defined(__x86_64__) |
| 23 | void 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 | |
| 30 | long long __mulh(long long, long long); |
| 31 | unsigned long long __umulh(unsigned long long, unsigned long long); |
| 32 | |
| 33 | void i() { |
| 34 | (void)__mulh(21, 2); |
| 35 | (void)__umulh(21, 2); |
| 36 | } |
| 37 | #endif |
| 38 | |
| 39 | #if defined(i386) |
| 40 | void 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 |