blob: b650393003fd0e0876f9d957a5a3342dcd2f5075 [file] [edit]
# Basic selection where -fmultilib-flag=debug selects the debug variant.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c %s -### -o /dev/null 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc -fmultilib-flag=debug \
# RUN: -ccc-install-dir %S/Inputs/multilib_msvc_tree/bin \
# RUN: | FileCheck --check-prefix=CHECK-DEBUG %s
# CHECK-DEBUG: "-cc1" "-triple" "x86_64-pc-windows-msvc
# CHECK-DEBUG: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/debug"
# CHECK-DEBUG: "-libpath:{{[^"]*}}/debug"
# Default behavior where no variant path is prepended.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c %s -### -o /dev/null 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc \
# RUN: -ccc-install-dir %S/Inputs/multilib_msvc_tree/bin \
# RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s
# CHECK-DEFAULT-NOT: "-libpath:{{[^"]*}}/debug"
# CHECK-DEFAULT-NOT: "-libpath:{{[^"]*}}/release"
# CHECK-DEFAULT-NOT: "-libpath:{{[^"]*}}/noexcept"
# CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/debug"
# CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/release"
# CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/noexcept"
# Multiple matches stacking on top of each-other.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -x c %s -### -o /dev/null 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc -fmultilib-flag=debug -fno-exceptions \
# RUN: -ccc-install-dir %S/Inputs/multilib_msvc_tree/bin \
# RUN: | FileCheck --check-prefix=CHECK-LAYERED %s
# CHECK-LAYERED: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/noexcept"
# CHECK-LAYERED-SAME: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-pc-windows-msvc/debug"
# CHECK-LAYERED: "-libpath:{{[^"]*}}/noexcept"
# CHECK-LAYERED-SAME: "-libpath:{{[^"]*}}/debug"
# Lists selected variant directories.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc -fmultilib-flag=debug \
# RUN: | FileCheck --check-prefix=CHECK-PRINT-DIR %s
# CHECK-PRINT-DIR: debug
# Lists all non-default variants with flags.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-lib 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc \
# RUN: | FileCheck --check-prefix=CHECK-PRINT-LIB %s
# CHECK-PRINT-LIB: debug;@fmultilib-flag=debug
# CHECK-PRINT-LIB: release;@fmultilib-flag=release
# CHECK-PRINT-LIB: noexcept;@fno-exceptions
# Error emitted when custom flag value is invalid.
# RUN: not %clang --multi-lib-config=%s -no-canonical-prefixes -x c %s -### -o /dev/null 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc -fmultilib-flag=nonexistent \
# RUN: | FileCheck --check-prefix=CHECK-NOMATCH %s
# CHECK-NOMATCH: error: unsupported option '-fmultilib-flag=nonexistent'
# Check exclusivity so that only one of debug/release selected.
# RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-directory 2>&1 \
# RUN: --target=x86_64-pc-windows-msvc -fmultilib-flag=release \
# RUN: | FileCheck --check-prefix=CHECK-EXCLUSIVE %s
# CHECK-EXCLUSIVE: release
# CHECK-EXCLUSIVE-NOT: debug
---
MultilibVersion: 1.0
Groups:
- Name: build-type
Type: Exclusive
Variants:
- Dir: .
Flags: []
- Dir: debug
Flags: [-fmultilib-flag=debug]
Group: build-type
- Dir: release
Flags: [-fmultilib-flag=release]
Group: build-type
- Dir: noexcept
Flags: [-fno-exceptions]
Mappings: []
Flags:
- Name: build-type
Values:
- Name: none
- Name: debug
- Name: release
Default: none
...