Skip to content

Commit 56faead

Browse files
[NFC] Adding missing flang tests for LTO bugfix
Pull request #78749 introduced a fix for passing vector library flags from clang frontend to opt when LTO is used. The fix also covered flang, as it's handled in CommonArgs.cpp, but no testing was added for flang.
1 parent 589b21f commit 56faead

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

flang/test/Driver/fveclib.f90

+17
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,20 @@
3030

3131
! TODO: if we add support for -nostdlib or -nodefaultlibs we need to test that
3232
! these prevent "-framework Accelerate" being added on Darwin
33+
34+
! Verify that the correct vector library is passed to LTO flags.
35+
36+
! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fveclib=LIBMVEC -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-LIBMVEC %s
37+
! CHECK-LTO-LIBMVEC: "-plugin-opt=-vector-library=LIBMVEC-X86"
38+
39+
! RUN: %flang -### --target=powerpc64-unknown-linux-gnu -fveclib=MASSV -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-MASSV %s
40+
! CHECK-LTO-MASSV: "-plugin-opt=-vector-library=MASSV"
41+
42+
! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fveclib=SVML -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-SVML %s
43+
! CHECK-LTO-SVML: "-plugin-opt=-vector-library=SVML"
44+
45+
! RUN: %flang -### --target=aarch64-linux-gnu -fveclib=SLEEF -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-SLEEF %s
46+
! CHECK-LTO-SLEEF: "-plugin-opt=-vector-library=sleefgnuabi"
47+
48+
! RUN: %flang -### --target=aarch64-linux-gnu -fveclib=ArmPL -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-ARMPL %s
49+
! CHECK-LTO-ARMPL: "-plugin-opt=-vector-library=ArmPL"

0 commit comments

Comments
 (0)