# 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-linux-gnu -fmultilib-flag=debug --sysroot= \ # RUN: -ccc-install-dir %S/Inputs/multilib_linux_tree/usr/bin \ # RUN: | FileCheck --check-prefix=CHECK-DEBUG %s # CHECK-DEBUG: "-cc1" "-triple" "x86_64-unknown-linux-gnu" # CHECK-DEBUG: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/debug" # CHECK-DEBUG: "-L{{[^"]*}}/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-linux-gnu --sysroot= \ # RUN: -ccc-install-dir %S/Inputs/multilib_linux_tree/usr/bin \ # RUN: | FileCheck --check-prefix=CHECK-DEFAULT %s # CHECK-DEFAULT-NOT: "-L{{[^"]*}}/debug" # CHECK-DEFAULT-NOT: "-L{{[^"]*}}/release" # CHECK-DEFAULT-NOT: "-L{{[^"]*}}/noexcept" # CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/debug" # CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/release" # CHECK-DEFAULT-NOT: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/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-linux-gnu -fmultilib-flag=debug -fno-exceptions --sysroot= \ # RUN: -ccc-install-dir %S/Inputs/multilib_linux_tree/usr/bin \ # RUN: | FileCheck --check-prefix=CHECK-LAYERED %s # CHECK-LAYERED: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/noexcept" # CHECK-LAYERED-SAME: "-internal-isystem" "{{[^"]*}}{{[/\\]}}x86_64-unknown-linux-gnu/debug" # CHECK-LAYERED: "-L{{[^"]*}}/noexcept" # CHECK-LAYERED-SAME: "-L{{[^"]*}}/debug" # Lists selected variant directories. # RUN: %clang --multi-lib-config=%s -no-canonical-prefixes -print-multi-directory 2>&1 \ # RUN: --target=x86_64-linux-gnu -fmultilib-flag=debug --sysroot= \ # 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-linux-gnu --sysroot= \ # 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-linux-gnu -fmultilib-flag=nonexistent --sysroot= \ # 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-linux-gnu -fmultilib-flag=release --sysroot= \ # 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 ...