xref: /llvm-project/libcxx/test/std/utilities/charconv/charconv.msvc/test.pass.cpp (revision b7042b73a3999d5ca3ff1fee2dd4abc1061f800d)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14
10 
11 // to_chars requires functions in the dylib that have not been introduced in older
12 // versions of the dylib on macOS.
13 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0}}
14 
15 // steady_clock requires threads.
16 // UNSUPPORTED: libcpp-has-no-threads
17 // UNSUPPORTED: libcpp-has-no-random-device
18 // UNSUPPORTED: libcpp-has-no-localization
19 
20 // XFAIL: LIBCXX-AIX-FIXME
21 
22 // <charconv>
23 
24 #include <type_traits>
25 
26 // Work-around for sprintf_s's usage in the Microsoft tests.
27 #ifndef _WIN32
28 #  define sprintf_s snprintf
29 #endif
30 
31 #ifdef _MSVC_STL_VERSION
32 #include <xutility>
33 using std::_Bit_cast;
34 #else
35 // FUNCTION TEMPLATE _Bit_cast
36 template <class _To, class _From,
37           std::enable_if_t<sizeof(_To) == sizeof(_From) && std::is_trivially_copyable_v<_To> &&
38                                std::is_trivially_copyable_v<_From>,
39                            int> = 0>
40 [[nodiscard]] constexpr _To _Bit_cast(const _From& _From_obj) noexcept {
41   return __builtin_bit_cast(_To, _From_obj);
42 }
43 #endif
44 
45 // Includes Microsoft's test that tests the entire header.
46 
47 #include "test.cpp"
48