Skip to content

Commit 270ff91

Browse files
committed
glibc version test feature
1 parent 7bfffab commit 270ff91

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// XFAIL: darwin
1515
// XFAIL: freebsd
1616
// XFAIL: windows
17+
// XFAIL: glibc-no-char8_t-support
1718
// XFAIL: LIBCXX-PICOLIBC-FIXME
1819

1920
// <uchar.h>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// XFAIL: darwin
1515
// XFAIL: freebsd
1616
// XFAIL: windows
17+
// XFAIL: glibc-no-char8_t-support
1718
// XFAIL: LIBCXX-PICOLIBC-FIXME
1819

1920
// <cuchar>

libcxx/utils/libcxx/test/features.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,23 @@ def _mingwSupportsModules(cfg):
293293
""",
294294
),
295295
),
296+
# Check for Glibc < 2.36, where there was no support for char8_t functions
297+
Feature(
298+
name="glibc-no-char8_t-support",
299+
when=lambda cfg: "__GLIBC__" in compilerMacros(cfg)
300+
and not sourceBuilds(
301+
cfg,
302+
"""
303+
#include <uchar.h>
304+
#include <wchar.h>
305+
int main(void) {
306+
char8_t c;
307+
mbstate_t s = {0};
308+
return (mbrtoc8(&c, "", 0, &s), 0);
309+
}
310+
""",
311+
),
312+
),
296313
Feature(
297314
name="has-unix-headers",
298315
when=lambda cfg: sourceBuilds(

0 commit comments

Comments
 (0)