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// REQUIRES: locale.en_US.UTF-8
10
11// <locale>
12
13// basic_string<char> name() const;
14
15#include <locale>
16#include <cassert>
17
18#include "test_macros.h"
19#include "platform_support.h" // locale name macros
20
21int main(int, char**)
22{
23 {
24 std::locale loc;
25 assert(loc.name() == "C");
26 }
27 {
28 std::locale loc(LOCALE_en_US_UTF_8);
29 assert(loc.name() == LOCALE_en_US_UTF_8);
30 }
31
32 return 0;
33}
34

source code of libcxx/test/std/localization/locales/locale/locale.members/name.pass.cpp