[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / re / re.traits / getloc.pass.cpp
blobdbc35dec39aa3aa2f810210c67ef71902b3b27f4
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 // REQUIRES: locale.en_US.UTF-8
11 // <regex>
13 // template <class charT> struct regex_traits;
15 // locale_type getloc()const;
17 #include <regex>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "platform_support.h" // locale name macros
23 int main(int, char**)
26 std::regex_traits<char> t1;
27 assert(t1.getloc().name() == "C");
28 std::regex_traits<wchar_t> t2;
29 assert(t2.getloc().name() == "C");
32 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
33 std::regex_traits<char> t1;
34 assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
35 std::regex_traits<wchar_t> t2;
36 assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
39 return 0;