Matthew Voss f626b1f4ca [clang][FatLTO][UnifiedLTO] Pass -enable-matrix to the LTO driver
Unified LTO and Fat LTO do not use the regular LTO prelink pipeline when
-flto/-flto=full is specified on the command line, thus they require
LowerMatrixIntrinsicsPass to be run during the link stage. To enable
this, we pass -enable-matrix to the LTO driver, replicating ThinLTO
behavior. This fix was applied to ThinLTO in https://reviews.llvm.org/D153583.

This fixes #77621.
2024-01-11 16:52:35 -08:00

21 lines
1.1 KiB
C

// RUN: touch %t.o
// RUN: %clang -flto=thin -fenable-matrix %t.o -### --target=powerpc64-ibm-aix-xcoff 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX-AIX
// CHECK-THINLTO-MATRIX-AIX: "-bplugin_opt:-enable-matrix"
// RUN: %clang -flto=thin -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX
// CHECK-THINLTO-MATRIX: "-plugin-opt=-enable-matrix"
// RUN: %clang -flto -ffat-lto-objects -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX
// RUN: %clang -flto=thin -ffat-lto-objects -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX
// RUN: %clang -flto -funified-lto -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX
// RUN: %clang -flto=thin -funified-lto -fenable-matrix %t.o -### --target=x86_64-unknown-linux 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-THINLTO-MATRIX