llvm/clang/test/Driver/baremetal-multilib-custom-error.yaml

# REQUIRES: shell
# UNSUPPORTED: system-windows

# RUN: rm -rf %t
# RUN: mkdir -p %t/bin
# RUN: mkdir -p %t/lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib
# RUN: touch %t/lib/clang-runtimes/arm-none-eabi/thumb/v8-m.main/fp/lib/libclang_rt.builtins.a
# RUN: ln -s %clang %t/bin/clang
# RUN: ln -s %s %t/lib/clang-runtimes/multilib.yaml

# RUN: %t/bin/clang -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN:     --target=thumbv8m.main-none-eabi -march=armv8.1m.main --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-DIRECTORY-NOMVE-SOFTFLOAT %s
# CHECK-PRINT-MULTI-DIRECTORY-NOMVE-SOFTFLOAT: nomve-softfloat

# RUN: not %t/bin/clang -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN:     --target=thumbv8m.main-none-eabi -march=armv8.1m.main+mve --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-ERROR %s
# CHECK-ERROR: multilib configuration error: mve-softfloat is not supported

# RUN: %t/bin/clang -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN:     --target=thumbv8m.main-none-eabi -march=armv8.1m.main+mve -mfloat-abi=hard --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-DIRECTORY-MVE-HARDFLOAT %s
# CHECK-PRINT-MULTI-DIRECTORY-MVE-HARDFLOAT: mve-hardfloat

# RUN: %t/bin/clang -no-canonical-prefixes -print-multi-lib 2>&1 \
# RUN:     --target=arm-none-eabi --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-PRINT-MULTI-LIB %s
# CHECK-PRINT-MULTI-LIB: nomve-softfloat;@-target=thumbv8.1m.main-unknown-none-eabi
# CHECK-PRINT-MULTI-LIB-NEXT: mve-hardfloat;@-target=thumbv8.1m.main-unknown-none-eabihf@march=thumbv8.1m.main+mve@mfloat-abi=hard

# RUN: %t/bin/clang -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN:     --target=arm-none-eabi --sysroot= \
# RUN:   | FileCheck --check-prefix=CHECK-NO-MATCH-WARNING %s
# CHECK-NO-MATCH-WARNING: clang: note: available multilibs are:
# CHECK-NO-MATCH-WARNING-NEXT: --target=thumbv8.1m.main-unknown-none-eabi
# CHECK-NO-MATCH-WARNING-NEXT: --target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfloat-abi=hard

---
MultilibVersion: 1.0

Variants:
- Dir: nomve-softfloat
  Flags:
  - --target=thumbv8.1m.main-unknown-none-eabi

- FatalError: mve-softfloat is not supported
  Flags: 
  - --target=thumbv8.1m.main-unknown-none-eabi
  - -march=thumbv8.1m.main+mve

- Dir: mve-hardfloat
  Flags: 
  - --target=thumbv8.1m.main-unknown-none-eabihf
  - -march=thumbv8.1m.main+mve
  - -mfloat-abi=hard

Mappings:
- Match: -march=thumbv8\.1m\.main(\+[^\+]+)*\+mve(\+[^\+]+)*
  Flags:
  - -march=thumbv8.1m.main+mve

...