[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / localization / c.locales / clocale.pass.cpp
blob3b53481ccfcd4b3de2ad9cdec794d0d208c4e085
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 //===----------------------------------------------------------------------===//
9 // <clocale>
11 #include <clocale>
12 #include <type_traits>
14 #include "test_macros.h"
16 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
18 #ifndef LC_ALL
19 #error LC_ALL not defined
20 #endif
22 #ifndef LC_COLLATE
23 #error LC_COLLATE not defined
24 #endif
26 #ifndef LC_CTYPE
27 #error LC_CTYPE not defined
28 #endif
30 #ifndef LC_MONETARY
31 #error LC_MONETARY not defined
32 #endif
34 #ifndef LC_NUMERIC
35 #error LC_NUMERIC not defined
36 #endif
38 #ifndef LC_TIME
39 #error LC_TIME not defined
40 #endif
42 #endif // !_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
44 #ifndef NULL
45 #error NULL not defined
46 #endif
48 int main(int, char**)
50 std::lconv lc;
51 ((void)lc); // Prevent unused warning
52 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
53 static_assert((std::is_same<decltype(std::setlocale(0, "")), char*>::value), "");
54 #endif
55 static_assert((std::is_same<decltype(std::localeconv()), std::lconv*>::value), "");
57 return 0;