Files
clang-p2996/clang/test/Driver/baremetal-multilib-layered.yaml
Lucas Duarte Prates da759dda58 [Clang][Driver] Add option to provide path for multilib's YAML config file (#109640)
Since the introduction of the use of a YAML file to configure the
selection of multilibs for baremetal, the path for that file has been
hardcoded into the clang driver code. This makes it difficult to provide
any alternative configurations for multilib and, by consequence, impacts
the tetability of any changes related to it - e.g. the existing multilib
YAML tests currently rely on creating fake toolchain directories to
inject their own configuration files.

This change introduces a new command line option to the clang driver,
`--multi-lib-config=`, to enable the use of a custom path to be used
when loading the multilib YAML config file. It also updates the existing
multilib YAML tests to use the new option.
2024-10-07 08:56:17 +01:00

40 lines
1.7 KiB
YAML

# REQUIRES: shell
# UNSUPPORTED: system-windows
# This test demonstrates "layered" multilib in which more than one
# multilib is matched.
# For example a multilib containing only a no-exceptions libc++ could
# be layered on top of a multilib containing C libs. This avoids the
# need to duplicate the C library for every libc++ variant.
# However -fno-exceptions is not yet supported for multilib selection
# so we use a more contrived -mfloat-abi example instead.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c++ %s -### -o %t.out 2>&1 \
# RUN: --target=thumbv7m-none-eabi -mfloat-abi=softfp --sysroot= \
# RUN: | FileCheck %s
# CHECK: "-cc1" "-triple" "thumbv7m-unknown-none-eabi"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT:[^"]*]]/bin/../lib/clang-runtimes/softfp/include/c++/v1"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/soft/include/c++/v1"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/softfp/include"
# CHECK-SAME: "-internal-isystem" "[[SYSROOT]]/bin/../lib/clang-runtimes/soft/include"
# CHECK-NEXT: "-L[[SYSROOT]]/bin/../lib/clang-runtimes/softfp/lib"
# CHECK-SAME: "-L[[SYSROOT]]/bin/../lib/clang-runtimes/soft/lib"
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN: --target=arm-none-eabi -mfloat-abi=softfp --sysroot= \
# RUN: | FileCheck --check-prefix=CHECK-PRINT-MULTI-DIRECTORY %s
# CHECK-PRINT-MULTI-DIRECTORY: soft
# CHECK-PRINT-MULTI-DIRECTORY-NEXT: softfp
---
MultilibVersion: 1.0
Variants:
- Dir: soft
Flags: [-mfloat-abi=soft]
- Dir: softfp
Flags: [-mfloat-abi=softfp]
Mappings:
- Match: -mfloat-abi=softfp
Flags: [-mfloat-abi=soft]
...