45 lines · c
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s -fms-extensions2// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -verify %s -fms-extensions3 4void f(void) {5 (void)_byteswap_ushort(42); // expected-error{{call to undeclared library function '_byteswap_ushort'}} \6 // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_ushort'}}7 (void)_byteswap_uint64(42LL); // expected-error{{call to undeclared library function '_byteswap_uint64'}} \8 // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_uint64'}}9}10 11void _byteswap_ulong(void); // 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(void) {18 (void)_byteswap_ushort(42);19 (void)_byteswap_uint64(42LL);20}21 22#if defined(__x86_64__)23void h(void) {24 (void)__mulh(21, 2); // expected-error{{call to undeclared library function '__mulh'}} \25 // expected-note{{include the header <intrin.h> or explicitly provide a declaration for '__mulh'}}26 (void)__umulh(21, 2); // expected-error{{call to undeclared 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(void) {34 (void)__mulh(21, 2);35 (void)__umulh(21, 2);36}37#endif38 39#if defined(i386)40void h(void) {41 (void)__mulh(21LL, 2LL); // expected-error{{call to undeclared function '__mulh'; ISO C99 and later do not support implicit function declarations}}42 (void)__umulh(21ULL, 2ULL); // expected-error{{call to undeclared function '__umulh'; ISO C99 and later do not support implicit function declarations}}43}44#endif45