diff options
author | Albert Gutowski <agutowski@google.com> | 2016-09-14 21:19:43 +0000 |
---|---|---|
committer | Albert Gutowski <agutowski@google.com> | 2016-09-14 21:19:43 +0000 |
commit | 727ab8a80346eeec39e13293f5dc01cc82bb1d95 (patch) | |
tree | 3a335f82c698d044fa05b5717a739ecaa762dd46 /clang/test/Sema/implicit-ms-builtin-decl.c | |
parent | ecdab09bafa497d918878746cbc756dd23e7fdec (diff) | |
download | bcm5719-llvm-727ab8a80346eeec39e13293f5dc01cc82bb1d95.tar.gz bcm5719-llvm-727ab8a80346eeec39e13293f5dc01cc82bb1d95.zip |
Add some MS aliases for existing intrinsics
Reviewers: thakis, compnerd, majnemer, rsmith, rnk
Subscribers: alexshap, cfe-commits
Differential Revision: https://reviews.llvm.org/D24330
llvm-svn: 281540
Diffstat (limited to 'clang/test/Sema/implicit-ms-builtin-decl.c')
-rw-r--r-- | clang/test/Sema/implicit-ms-builtin-decl.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Sema/implicit-ms-builtin-decl.c b/clang/test/Sema/implicit-ms-builtin-decl.c new file mode 100644 index 00000000000..e43d8f867d8 --- /dev/null +++ b/clang/test/Sema/implicit-ms-builtin-decl.c @@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s -fms-extensions + +void f() { + (void)_byteswap_ushort(42); // expected-warning{{implicitly declaring library function '_byteswap_ushort}} \ + // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_ushort'}} + (void)_byteswap_uint64(42LL); // expected-warning{{implicitly declaring library function '_byteswap_uint64}} \ + // expected-note{{include the header <stdlib.h> or explicitly provide a declaration for '_byteswap_uint64'}} +} + +void _byteswap_ulong(); // expected-warning{{incompatible redeclaration of library function '_byteswap_ulong'}} \ +// expected-note{{'_byteswap_ulong' is a builtin}} + +unsigned short _byteswap_ushort(unsigned short); +unsigned long long _byteswap_uint64(unsigned long long); + +void g() { + (void)_byteswap_ushort(42); + (void)_byteswap_uint64(42LL); +} |