• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
9from libcxx.test.dsl import *
10from lit.BooleanExpression import BooleanExpression
11import re
12import shutil
13import subprocess
14import sys
15
16_isClang = lambda cfg: "__clang__" in compilerMacros(cfg) and "__apple_build_version__" not in compilerMacros(cfg)
17_isAppleClang = lambda cfg: "__apple_build_version__" in compilerMacros(cfg)
18_isGCC = lambda cfg: "__GNUC__" in compilerMacros(cfg) and "__clang__" not in compilerMacros(cfg)
19_isMSVC = lambda cfg: "_MSC_VER" in compilerMacros(cfg)
20_msvcVersion = lambda cfg: (int(compilerMacros(cfg)["_MSC_VER"]) // 100, int(compilerMacros(cfg)["_MSC_VER"]) % 100)
21
22
23def _getSuitableClangTidy(cfg):
24    try:
25        # If we didn't build the libcxx-tidy plugin via CMake, we can't run the clang-tidy tests.
26        if runScriptExitCode(cfg, ["stat %{test-tools}/clang_tidy_checks/libcxx-tidy.plugin"]) != 0:
27            return None
28
29        # TODO MODULES require ToT due module specific fixes.
30        if runScriptExitCode(cfg, ['clang-tidy-17 --version']) == 0:
31          return 'clang-tidy-17'
32
33        # TODO This should be the last stable release.
34        # LLVM RELEASE bump to latest stable version
35        if runScriptExitCode(cfg, ["clang-tidy-16 --version"]) == 0:
36            return "clang-tidy-16"
37
38        # LLVM RELEASE bump version
39        if int(re.search("[0-9]+", commandOutput(cfg, ["clang-tidy --version"])).group()) >= 16:
40            return "clang-tidy"
41
42    except ConfigurationRuntimeError:
43        return None
44
45
46def _getAndroidDeviceApi(cfg):
47    return int(
48        programOutput(
49            cfg,
50            r"""
51                #include <android/api-level.h>
52                #include <stdio.h>
53                int main() {
54                    printf("%d\n", android_get_device_api_level());
55                    return 0;
56                }
57            """,
58        )
59    )
60
61# Lit features are evaluated in order. Some checks may require the compiler detection to have
62# run first in order to work properly.
63DEFAULT_FEATURES = [
64    Feature(name="apple-clang", when=_isAppleClang),
65    Feature(
66        name=lambda cfg: "apple-clang-{__clang_major__}".format(**compilerMacros(cfg)),
67        when=_isAppleClang,
68    ),
69    Feature(
70        name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}".format(**compilerMacros(cfg)),
71        when=_isAppleClang,
72    ),
73    Feature(
74        name=lambda cfg: "apple-clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(**compilerMacros(cfg)),
75        when=_isAppleClang,
76    ),
77    Feature(name="clang", when=_isClang),
78    Feature(
79        name=lambda cfg: "clang-{__clang_major__}".format(**compilerMacros(cfg)),
80        when=_isClang,
81    ),
82    Feature(
83        name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}".format(**compilerMacros(cfg)),
84        when=_isClang,
85    ),
86    Feature(
87        name=lambda cfg: "clang-{__clang_major__}.{__clang_minor__}.{__clang_patchlevel__}".format(**compilerMacros(cfg)),
88        when=_isClang,
89    ),
90    # Note: Due to a GCC bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104760), we must disable deprecation warnings
91    #       on GCC or spurious diagnostics are issued.
92    #
93    # TODO:
94    # - Enable -Wplacement-new with GCC.
95    # - Enable -Wclass-memaccess with GCC.
96    Feature(
97        name="gcc",
98        when=_isGCC,
99        actions=[
100            AddCompileFlag("-D_LIBCPP_DISABLE_DEPRECATION_WARNINGS"),
101            AddCompileFlag("-Wno-placement-new"),
102            AddCompileFlag("-Wno-class-memaccess"),
103            AddFeature("GCC-ALWAYS_INLINE-FIXME"),
104        ],
105    ),
106    Feature(
107        name=lambda cfg: "gcc-{__GNUC__}".format(**compilerMacros(cfg)), when=_isGCC
108    ),
109    Feature(
110        name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}".format(**compilerMacros(cfg)),
111        when=_isGCC,
112    ),
113    Feature(
114        name=lambda cfg: "gcc-{__GNUC__}.{__GNUC_MINOR__}.{__GNUC_PATCHLEVEL__}".format(**compilerMacros(cfg)),
115        when=_isGCC,
116    ),
117    Feature(name="msvc", when=_isMSVC),
118    Feature(name=lambda cfg: "msvc-{}".format(*_msvcVersion(cfg)), when=_isMSVC),
119    Feature(name=lambda cfg: "msvc-{}.{}".format(*_msvcVersion(cfg)), when=_isMSVC),
120
121    Feature(
122        name="thread-safety",
123        when=lambda cfg: hasCompileFlag(cfg, "-Werror=thread-safety"),
124        actions=[AddCompileFlag("-Werror=thread-safety")],
125    ),
126    Feature(
127        name="diagnose-if-support",
128        when=lambda cfg: hasCompileFlag(cfg, "-Wuser-defined-warnings"),
129        actions=[AddCompileFlag("-Wuser-defined-warnings")],
130    ),
131    # Tests to validate whether the compiler has a way to set the maximum number
132    # of steps during constant evaluation. Since the flag differs per compiler
133    # store the "valid" flag as a feature. This allows passing the proper compile
134    # flag to the compiler:
135    # // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-steps): -fconstexpr-steps=12345678
136    # // ADDITIONAL_COMPILE_FLAGS(has-fconstexpr-ops-limit): -fconstexpr-ops-limit=12345678
137    Feature(
138        name="has-fconstexpr-steps",
139        when=lambda cfg: hasCompileFlag(cfg, "-fconstexpr-steps=1"),
140    ),
141    Feature(
142        name="has-fconstexpr-ops-limit",
143        when=lambda cfg: hasCompileFlag(cfg, "-fconstexpr-ops-limit=1"),
144    ),
145    Feature(name="has-fblocks", when=lambda cfg: hasCompileFlag(cfg, "-fblocks")),
146    Feature(
147        name="-fsized-deallocation",
148        when=lambda cfg: hasCompileFlag(cfg, "-fsized-deallocation"),
149    ),
150    Feature(
151        name="-faligned-allocation",
152        when=lambda cfg: hasCompileFlag(cfg, "-faligned-allocation"),
153    ),
154    Feature(
155        name="fdelayed-template-parsing",
156        when=lambda cfg: hasCompileFlag(cfg, "-fdelayed-template-parsing"),
157    ),
158    Feature(
159        name="has-fobjc-arc",
160        when=lambda cfg: hasCompileFlag(cfg, "-xobjective-c++ -fobjc-arc")
161        and sys.platform.lower().strip() == "darwin",
162    ),  # TODO: this doesn't handle cross-compiling to Apple platforms.
163    Feature(
164        name="objective-c++",
165        when=lambda cfg: hasCompileFlag(cfg, "-xobjective-c++ -fobjc-arc"),
166    ),
167    Feature(
168        name="verify-support",
169        when=lambda cfg: hasCompileFlag(cfg, "-Xclang -verify-ignore-unexpected"),
170    ),
171    Feature(
172        name="add-latomic-workaround",  # https://github.com/llvm/llvm-project/issues/73361
173        when=lambda cfg: sourceBuilds(
174            cfg, "int main(int, char**) { return 0; }", ["-latomic"]
175        ),
176        actions=[AddLinkFlag("-latomic")],
177    ),
178    Feature(
179        name="non-lockfree-atomics",
180        when=lambda cfg: sourceBuilds(
181            cfg,
182            """
183            #include <atomic>
184            struct Large { int storage[100]; };
185            std::atomic<Large> x;
186            int main(int, char**) { (void)x.load(); return 0; }
187          """,
188        ),
189    ),
190    Feature(
191        name="has-64-bit-atomics",
192        when=lambda cfg: sourceBuilds(
193            cfg,
194            """
195            #include <atomic>
196            std::atomic_uint64_t x;
197            int main(int, char**) { (void)x.load(); return 0; }
198          """,
199        ),
200    ),
201    # TODO: Remove this feature once compiler-rt includes __atomic_is_lockfree()
202    # on all supported platforms.
203    Feature(
204        name="is-lockfree-runtime-function",
205        when=lambda cfg: sourceBuilds(
206            cfg,
207            """
208            #include <atomic>
209            struct Large { int storage[100]; };
210            std::atomic<Large> x;
211            int main(int, char**) { return x.is_lock_free(); }
212          """,
213        ),
214    ),
215    # Check for a Windows UCRT bug (fixed in UCRT/Windows 10.0.20348.0):
216    # https://developercommunity.visualstudio.com/t/utf-8-locales-break-ctype-functions-for-wchar-type/1653678
217    Feature(
218        name="win32-broken-utf8-wchar-ctype",
219        when=lambda cfg: not "_LIBCPP_HAS_NO_LOCALIZATION" in compilerMacros(cfg)
220        and "_WIN32" in compilerMacros(cfg)
221        and not programSucceeds(
222            cfg,
223            """
224            #include <locale.h>
225            #include <wctype.h>
226            int main(int, char**) {
227              setlocale(LC_ALL, "en_US.UTF-8");
228              return towlower(L'\\xDA') != L'\\xFA';
229            }
230          """,
231        ),
232    ),
233    # Check for a Windows UCRT bug (fixed in UCRT/Windows 10.0.19041.0).
234    # https://developercommunity.visualstudio.com/t/printf-formatting-with-g-outputs-too/1660837
235    Feature(
236        name="win32-broken-printf-g-precision",
237        when=lambda cfg: "_WIN32" in compilerMacros(cfg)
238        and not programSucceeds(
239            cfg,
240            """
241            #include <stdio.h>
242            #include <string.h>
243            int main(int, char**) {
244              char buf[100];
245              snprintf(buf, sizeof(buf), "%#.*g", 0, 0.0);
246              return strcmp(buf, "0.");
247            }
248          """,
249        ),
250    ),
251    # Check for Glibc < 2.27, where the ru_RU.UTF-8 locale had
252    # mon_decimal_point == ".", which our tests don't handle.
253    Feature(
254        name="glibc-old-ru_RU-decimal-point",
255        when=lambda cfg: not "_LIBCPP_HAS_NO_LOCALIZATION" in compilerMacros(cfg)
256        and not programSucceeds(
257            cfg,
258            """
259            #include <locale.h>
260            #include <string.h>
261            int main(int, char**) {
262              setlocale(LC_ALL, "ru_RU.UTF-8");
263              return strcmp(localeconv()->mon_decimal_point, ",");
264            }
265          """,
266        ),
267    ),
268    Feature(
269        name="has-unix-headers",
270        when=lambda cfg: sourceBuilds(
271            cfg,
272            """
273            #include <unistd.h>
274            #include <sys/wait.h>
275            int main(int, char**) {
276              int fd[2];
277              return pipe(fd);
278            }
279          """,
280        ),
281    ),
282    # Whether Bash can run on the executor.
283    # This is not always the case, for example when running on embedded systems.
284    #
285    # For the corner case of bash existing, but it being missing in the path
286    # set in %{exec} as "--env PATH=one-single-dir", the executor does find
287    # and executes bash, but bash then can't find any other common shell
288    # utilities. Test executing "bash -c 'bash --version'" to see if bash
289    # manages to find binaries to execute.
290    Feature(
291        name="executor-has-no-bash",
292        when=lambda cfg: runScriptExitCode(cfg, ["%{exec} bash -c 'bash --version'"]) != 0,
293    ),
294    Feature(
295        name="has-clang-tidy",
296        when=lambda cfg: _getSuitableClangTidy(cfg) is not None,
297        actions=[
298            AddSubstitution("%{clang-tidy}", lambda cfg: _getSuitableClangTidy(cfg))
299        ],
300    ),
301]
302
303# Deduce and add the test features that that are implied by the #defines in
304# the <__config_site> header.
305#
306# For each macro of the form `_LIBCPP_XXX_YYY_ZZZ` defined below that
307# is defined after including <__config_site>, add a Lit feature called
308# `libcpp-xxx-yyy-zzz`. When a macro is defined to a specific value
309# (e.g. `_LIBCPP_ABI_VERSION=2`), the feature is `libcpp-xxx-yyy-zzz=<value>`.
310#
311# Note that features that are more strongly tied to libc++ are named libcpp-foo,
312# while features that are more general in nature are not prefixed with 'libcpp-'.
313macros = {
314    "_LIBCPP_HAS_NO_MONOTONIC_CLOCK": "no-monotonic-clock",
315    "_LIBCPP_HAS_NO_THREADS": "no-threads",
316    "_LIBCPP_HAS_THREAD_API_EXTERNAL": "libcpp-has-thread-api-external",
317    "_LIBCPP_HAS_THREAD_API_PTHREAD": "libcpp-has-thread-api-pthread",
318    "_LIBCPP_NO_VCRUNTIME": "libcpp-no-vcruntime",
319    "_LIBCPP_ABI_VERSION": "libcpp-abi-version",
320    "_LIBCPP_ABI_BOUNDED_ITERATORS": "libcpp-has-abi-bounded-iterators",
321    "_LIBCPP_HAS_NO_FILESYSTEM": "no-filesystem",
322    "_LIBCPP_HAS_NO_RANDOM_DEVICE": "no-random-device",
323    "_LIBCPP_HAS_NO_LOCALIZATION": "no-localization",
324    "_LIBCPP_HAS_NO_WIDE_CHARACTERS": "no-wide-characters",
325    "_LIBCPP_HAS_NO_TIME_ZONE_DATABASE": "no-tzdb",
326    "_LIBCPP_HAS_NO_UNICODE": "libcpp-has-no-unicode",
327    "_LIBCPP_HAS_NO_STD_MODULES":  "libcpp-has-no-std-modules",
328    "_LIBCPP_PSTL_CPU_BACKEND_LIBDISPATCH": "libcpp-pstl-cpu-backend-libdispatch",
329}
330for macro, feature in macros.items():
331    DEFAULT_FEATURES.append(
332        Feature(
333            name=lambda cfg, m=macro, f=feature: f + ("={}".format(compilerMacros(cfg)[m]) if compilerMacros(cfg)[m] else ""),
334            when=lambda cfg, m=macro: m in compilerMacros(cfg),
335        )
336    )
337
338
339# Mapping from canonical locale names (used in the tests) to possible locale
340# names on various systems. Each locale is considered supported if any of the
341# alternative names is supported.
342locales = {
343    "en_US.UTF-8": ["en_US.UTF-8", "en_US.utf8", "English_United States.1252"],
344    "fr_FR.UTF-8": ["fr_FR.UTF-8", "fr_FR.utf8", "French_France.1252"],
345    "ja_JP.UTF-8": ["ja_JP.UTF-8", "ja_JP.utf8", "Japanese_Japan.923"],
346    "ru_RU.UTF-8": ["ru_RU.UTF-8", "ru_RU.utf8", "Russian_Russia.1251"],
347    "zh_CN.UTF-8": ["zh_CN.UTF-8", "zh_CN.utf8", "Chinese_China.936"],
348    "fr_CA.ISO8859-1": ["fr_CA.ISO8859-1", "French_Canada.1252"],
349    "cs_CZ.ISO8859-2": ["cs_CZ.ISO8859-2", "Czech_Czech Republic.1250"],
350}
351for locale, alts in locales.items():
352    # Note: Using alts directly in the lambda body here will bind it to the value at the
353    # end of the loop. Assigning it to a default argument works around this issue.
354    DEFAULT_FEATURES.append(
355        Feature(
356            name="locale.{}".format(locale),
357            when=lambda cfg, alts=alts: hasAnyLocale(cfg, alts),
358        )
359    )
360
361
362# Add features representing the target platform name: darwin, linux, windows, etc...
363DEFAULT_FEATURES += [
364    Feature(name="darwin", when=lambda cfg: "__APPLE__" in compilerMacros(cfg)),
365    Feature(name="windows", when=lambda cfg: "_WIN32" in compilerMacros(cfg)),
366    Feature(
367        name="windows-dll",
368        when=lambda cfg: "_WIN32" in compilerMacros(cfg)
369        and sourceBuilds(
370            cfg,
371            """
372            #include <iostream>
373            int main(int, char**) { return 0; }
374          """,
375        )
376        and programSucceeds(
377            cfg,
378            """
379            #include <iostream>
380            #include <windows.h>
381            #include <winnt.h>
382            int main(int, char**) {
383              // Get a pointer to a data member that gets linked from the C++
384              // library. This must be a data member (functions can get
385              // thunk inside the calling executable), and must not be
386              // something that is defined inline in headers.
387              void *ptr = &std::cout;
388              // Get a handle to the current main executable.
389              void *exe = GetModuleHandle(NULL);
390              // The handle points at the PE image header. Navigate through
391              // the header structure to find the size of the PE image (the
392              // executable).
393              PIMAGE_DOS_HEADER dosheader = (PIMAGE_DOS_HEADER)exe;
394              PIMAGE_NT_HEADERS ntheader = (PIMAGE_NT_HEADERS)((BYTE *)dosheader + dosheader->e_lfanew);
395              PIMAGE_OPTIONAL_HEADER peheader = &ntheader->OptionalHeader;
396              void *exeend = (BYTE*)exe + peheader->SizeOfImage;
397              // Check if the tested pointer - the data symbol from the
398              // C++ library - is located within the exe.
399              if (ptr >= exe && ptr <= exeend)
400                return 1;
401              // Return success if it was outside of the executable, i.e.
402              // loaded from a DLL.
403              return 0;
404            }
405          """,
406        ),
407        actions=[AddCompileFlag("-DTEST_WINDOWS_DLL")],
408    ),
409    Feature(name="linux", when=lambda cfg: "__linux__" in compilerMacros(cfg)),
410    Feature(name="android", when=lambda cfg: "__ANDROID__" in compilerMacros(cfg)),
411    Feature(
412        name=lambda cfg: "android-device-api={}".format(_getAndroidDeviceApi(cfg)),
413        when=lambda cfg: "__ANDROID__" in compilerMacros(cfg),
414    ),
415    Feature(
416        name="LIBCXX-ANDROID-FIXME",
417        when=lambda cfg: "__ANDROID__" in compilerMacros(cfg),
418    ),
419    Feature(name="netbsd", when=lambda cfg: "__NetBSD__" in compilerMacros(cfg)),
420    Feature(name="freebsd", when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg)),
421    Feature(
422        name="LIBCXX-FREEBSD-FIXME",
423        when=lambda cfg: "__FreeBSD__" in compilerMacros(cfg),
424    ),
425    Feature(
426        name="LIBCXX-PICOLIBC-FIXME",
427        when=lambda cfg: sourceBuilds(
428            cfg,
429            """
430            #include <string.h>
431            #ifndef __PICOLIBC__
432            #error not picolibc
433            #endif
434            int main(int, char**) { return 0; }
435          """,
436        ),
437    ),
438]
439
440# Add features representing the build host platform name.
441# The build host could differ from the target platform for cross-compilation.
442DEFAULT_FEATURES += [
443    Feature(name="buildhost={}".format(sys.platform.lower().strip())),
444    # sys.platform can often be represented by a "sub-system", such as 'win32', 'cygwin', 'mingw', freebsd13 & etc.
445    # We define a consolidated feature on a few platforms.
446    Feature(
447        name="buildhost=windows",
448        when=lambda cfg: platform.system().lower().startswith("windows"),
449    ),
450    Feature(
451        name="buildhost=freebsd",
452        when=lambda cfg: platform.system().lower().startswith("freebsd"),
453    ),
454    Feature(
455        name="buildhost=aix",
456        when=lambda cfg: platform.system().lower().startswith("aix"),
457    ),
458]
459
460# Detect whether GDB is on the system, has Python scripting and supports
461# adding breakpoint commands. If so add a substitution to access it.
462def check_gdb(cfg):
463    gdb_path = shutil.which("gdb")
464    if gdb_path is None:
465        return False
466
467    # Check that we can set breakpoint commands, which was added in 8.3.
468    # Using the quit command here means that gdb itself exits, not just
469    # the "python <...>" command.
470    test_src = """\
471try:
472  gdb.Breakpoint(\"main\").commands=\"foo\"
473except AttributeError:
474  gdb.execute(\"quit 1\")
475gdb.execute(\"quit\")"""
476
477    try:
478        stdout = subprocess.check_output(
479            [gdb_path, "-ex", "python " + test_src, "--batch"],
480            stderr=subprocess.DEVNULL,
481            universal_newlines=True,
482        )
483    except subprocess.CalledProcessError:
484        # We can't set breakpoint commands
485        return False
486
487    # Check we actually ran the Python
488    return not "Python scripting is not supported" in stdout
489
490
491DEFAULT_FEATURES += [
492    Feature(
493        name="host-has-gdb-with-python",
494        when=check_gdb,
495        actions=[AddSubstitution("%{gdb}", lambda cfg: shutil.which("gdb"))],
496    )
497]
498
499# Define features for back-deployment testing.
500#
501# These features can be used to XFAIL tests that fail when deployed on (or compiled
502# for) an older system. For example, if a test exhibits a bug in the libc on a
503# particular system version, or if it uses a symbol that is not available on an
504# older version of the dylib, it can be marked as XFAIL with these features.
505#
506# It is sometimes useful to check that a test fails specifically when compiled for a
507# given deployment target. For example, this is the case when testing availability
508# markup, where we want to make sure that using the annotated facility on a deployment
509# target that doesn't support it will fail at compile time, not at runtime. This can
510# be achieved by creating a `.verify.cpp` test that checks for the right errors, and
511# mark that test as requiring `stdlib=<vendor>-libc++ && target=<target>`.
512DEFAULT_FEATURES += [
513    # Tests that require std::to_chars(floating-point) in the built library
514    Feature(
515        name="availability-fp_to_chars-missing",
516        when=lambda cfg: BooleanExpression.evaluate(
517            "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
518            cfg.available_features,
519        ),
520    ),
521    # Tests that require https://wg21.link/P0482 support in the built library
522    Feature(
523        name="availability-char8_t_support-missing",
524        when=lambda cfg: BooleanExpression.evaluate(
525            "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0)(.0)?}}",
526            cfg.available_features,
527        ),
528    ),
529    # Tests that require __libcpp_verbose_abort support in the built library
530    Feature(
531        name="availability-verbose_abort-missing",
532        when=lambda cfg: BooleanExpression.evaluate(
533            "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
534            cfg.available_features,
535        ),
536    ),
537    # Tests that require std::pmr support in the built library
538    Feature(
539        name="availability-pmr-missing",
540        when=lambda cfg: BooleanExpression.evaluate(
541            "stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
542            cfg.available_features,
543        ),
544    ),
545    # Tests that require std::filesystem support in the built library
546    Feature(
547        name="availability-filesystem-missing",
548        when=lambda cfg: BooleanExpression.evaluate(
549            "stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(13|14)(.0)?}}",
550            cfg.available_features,
551        ),
552    ),
553    # Tests that require the C++20 synchronization library (P1135R6 implemented by https://llvm.org/D68480) in the built library
554    Feature(
555        name="availability-synchronization_library-missing",
556        when=lambda cfg: BooleanExpression.evaluate(
557            "stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(13|14|15)(.0)?}}",
558            cfg.available_features,
559        ),
560    ),
561    # Tests that require time zone database support in the built library
562    Feature(
563        name="availability-tzdb-missing",
564        when=lambda cfg: BooleanExpression.evaluate(
565            # TODO(ldionne) Please provide the correct value.
566            "(stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}})",
567            cfg.available_features,
568        ),
569    ),
570    # Tests that require 64-bit architecture
571    Feature(
572        name="32-bit-pointer",
573        when=lambda cfg: sourceBuilds(
574            cfg,
575            """
576            int main(int, char**) {
577              static_assert(sizeof(void *) == 4);
578            }
579          """,
580        ),
581    ),
582]
583