Skip to content

Commit 678c833

Browse files
committed
List of changes:
- Move clang's case to the top. - Extract char8_t part of the tests into its own files. - Remove test that has little use. - Undo the creation of a feature just for the AIX platform.
1 parent 1735435 commit 678c833

File tree

7 files changed

+57
-61
lines changed

7 files changed

+57
-61
lines changed

libcxx/include/__config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,14 +1021,14 @@ typedef __char32_t char32_t;
10211021
// the latter depends on internal GNU libc details that are not appropriate
10221022
// to depend on here, so any declarations present when __cpp_char8_t is not
10231023
// defined are ignored.
1024-
# if defined(_LIBCPP_GLIBC_PREREQ)
1024+
# if defined(__clang__)
1025+
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
1026+
# elif defined(_LIBCPP_GLIBC_PREREQ)
10251027
# if _LIBCPP_GLIBC_PREREQ(2, 36) && defined(__cpp_char8_t)
10261028
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10271029
# else
10281030
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10291031
# endif
1030-
# elif defined(__clang__)
1031-
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 1
10321032
# else
10331033
# define _LIBCPP_HAS_C8RTOMB_MBRTOC8 0
10341034
# endif

libcxx/test/std/depr/depr.c.headers/uchar_h.compile.pass.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
1212
// XFAIL: target={{.+}}-apple-{{.+}}
1313

14-
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
15-
// XFAIL: aix
16-
// XFAIL: freebsd
17-
// XFAIL: windows
18-
1914
// mbrtoc16 not defined.
2015
// XFAIL: LIBCXX-PICOLIBC-FIXME
2116

@@ -28,11 +23,6 @@
2823
// __STDC_UTF_16__ may or may not be defined by the C standard library
2924
// __STDC_UTF_32__ may or may not be defined by the C standard library
3025

31-
#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
32-
ASSERT_SAME_TYPE(size_t, decltype(mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
33-
ASSERT_SAME_TYPE(size_t, decltype(c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
34-
#endif
35-
3626
ASSERT_SAME_TYPE(size_t, decltype(mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
3727
ASSERT_SAME_TYPE(size_t, decltype(c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
3828

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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
10+
11+
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
12+
// XFAIL: target={{.+}}-aix{{.*}}
13+
// XFAIL: darwin
14+
// XFAIL: freebsd
15+
// XFAIL: windows
16+
// XFAIL: LIBCXX-PICOLIBC-FIXME
17+
18+
// <uchar.h>
19+
20+
#include <uchar.h>
21+
22+
#include "test_macros.h"
23+
24+
#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
25+
ASSERT_SAME_TYPE(size_t, decltype(mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
26+
ASSERT_SAME_TYPE(size_t, decltype(c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
27+
#endif

libcxx/test/std/strings/c.strings/cuchar.compile.pass.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
// Apple platforms don't provide <uchar.h> yet, so these tests fail.
1212
// XFAIL: target={{.+}}-apple-{{.+}}
1313

14-
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
15-
// XFAIL: aix
16-
// XFAIL: freebsd
17-
// XFAIL: windows
18-
1914
// mbrtoc16 not defined.
2015
// XFAIL: LIBCXX-PICOLIBC-FIXME
2116

@@ -28,11 +23,6 @@
2823
// __STDC_UTF_16__ may or may not be defined by the C standard library
2924
// __STDC_UTF_32__ may or may not be defined by the C standard library
3025

31-
#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
32-
ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
33-
ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
34-
#endif
35-
3626
ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc16((char16_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
3727
ASSERT_SAME_TYPE(std::size_t, decltype(std::c16rtomb((char*)0, (char16_t)0, (mbstate_t*)0)));
3828

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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
10+
11+
// The following platforms do not provide mbrtoc8 and c8rtomb so the tests fail
12+
// XFAIL: target={{.+}}-aix{{.*}}
13+
// XFAIL: darwin
14+
// XFAIL: freebsd
15+
// XFAIL: windows
16+
// XFAIL: LIBCXX-PICOLIBC-FIXME
17+
18+
// <cuchar>
19+
20+
#include <cuchar>
21+
22+
#include "test_macros.h"
23+
24+
#if !defined(TEST_HAS_NO_C8RTOMB_MBRTOC8)
25+
ASSERT_SAME_TYPE(std::size_t, decltype(std::mbrtoc8((char8_t*)0, (const char*)0, (size_t)0, (mbstate_t*)0)));
26+
ASSERT_SAME_TYPE(std::size_t, decltype(std::c8rtomb((char*)0, (char8_t)0, (mbstate_t*)0)));
27+
#endif

libcxx/test/std/strings/c.strings/no_c8rtomb_mbrtoc8.verify.cpp

Lines changed: 0 additions & 37 deletions
This file was deleted.

libcxx/utils/libcxx/test/features.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ def _getLocaleFlagsAction(cfg, locale, alts, members):
669669
""",
670670
),
671671
),
672-
Feature(name="aix", when=lambda cfg: "_AIX" in compilerMacros(cfg)),
673672
]
674673

675674
# Add features representing the build host platform name.

0 commit comments

Comments
 (0)