brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 1a4b47c Raw
66 lines · plain
1#2# This testing configuration runs the test suite using the libstdc++ Standard library.3#4# The additional '--param libstdcxx_install_prefix=<PATH>', '--param libstdcxx_triple=<TRIPLE>' and5# '--param libstdcxx_version=<VERSION>' lit parameters must be provided when invoking lit for the6# configuration to find the appropriate headers and library.7#8# For example:9#10#  $ ./libcxx/utils/libcxx-lit <BUILD> -sv libcxx/test/std --param libstdcxx_install_prefix=/opt/homebrew/Cellar/gcc/14.1.0_1 \11#                                                          --param libstdcxx_version=14 \12#                                                          --param libstdcxx_triple=aarch64-apple-darwin22 \13#                                                          --param stdlib=libstdc++14#15 16lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')17 18import os, site19site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))20import libcxx.test.params, libcxx.test.config, libcxx.test.dsl21 22# Additional parameters for libstdc++23LIBSTDCXX_PARAMETERS = [24    libcxx.test.dsl.Parameter(name='libstdcxx_install_prefix', type=str,25        actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-install-prefix}', path)],26        help="""27        The installation prefix where libstdc++ was installed. This is used to find the libstdc++ headers,28        link against its built library, etc.29        """),30    libcxx.test.dsl.Parameter(name='libstdcxx_triple', type=str,31        actions=lambda triple: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-triple}', triple)],32        help="""33        The target triple used for the target-specific include directory of libstdc++. This is used to find the34        libstdc++ headers.35        """),36    libcxx.test.dsl.Parameter(name='libstdcxx_version', type=str,37        actions=lambda version: [libcxx.test.dsl.AddSubstitution('%{libstdcxx-version}', version)],38        help="""39        The version of libstdc++. This is used to find the libstdc++ headers and library.40        """),41]42 43# Configure the compiler and flags44config.substitutions.append(('%{flags}',45    '-pthread' + (' -isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '')46))47config.substitutions.append(('%{compile_flags}',48    '-nostdinc++ -isystem %{libstdcxx-install-prefix}/include/c++/%{libstdcxx-version} -isystem %{libstdcxx-install-prefix}/include/c++/%{libstdcxx-version}/%{libstdcxx-triple} -I %{libcxx-dir}/test/support'49))50config.substitutions.append(('%{link_flags}',51    '-nostdlib++ -L %{libstdcxx-install-prefix}/lib/gcc/%{libstdcxx-version} -Wl,-rpath,%{libstdcxx-install-prefix}/lib/gcc/%{libstdcxx-version} -lstdc++'52))53config.substitutions.append(('%{exec}',54    '%{executor} --execdir %{temp} -- '55))56 57import os, site58site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))59import libcxx.test.params, libcxx.test.config60libcxx.test.config.configure(61    libcxx.test.params.DEFAULT_PARAMETERS + LIBSTDCXX_PARAMETERS,62    libcxx.test.features.DEFAULT_FEATURES,63    config,64    lit_config65)66