From ae3fb3113ffc1ccccc95904e25baf11d11d0f14c Mon Sep 17 00:00:00 2001 From: Albert Gutowski Date: Tue, 13 Sep 2016 19:26:42 +0000 Subject: Add some MS aliases for existing intrinsics Reviewers: thakis, compnerd, majnemer, rsmith, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24330 llvm-svn: 281375 --- clang/test/Sema/implicit-ms-builtin-decl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 clang/test/Sema/implicit-ms-builtin-decl.c (limited to 'clang/test/Sema/implicit-ms-builtin-decl.c') 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 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 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); +} -- cgit v1.2.3