[flang-commits] [flang] [NFC] Adding missing flang tests for LTO bugfix (PR #80417)

Paschalis Mpeis via flang-commits flang-commits at lists.llvm.org
Fri Feb 2 04:00:47 PST 2024


https://github.com/paschalis-mpeis created https://github.com/llvm/llvm-project/pull/80417

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.

>From 56faeadc172d7ae45266a0aa1908e6c6f7ebfb21 Mon Sep 17 00:00:00 2001
From: Paschalis Mpeis <Paschalis.Mpeis at arm.com>
Date: Fri, 2 Feb 2024 11:15:04 +0000
Subject: [PATCH] [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.
---
 flang/test/Driver/fveclib.f90 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/flang/test/Driver/fveclib.f90 b/flang/test/Driver/fveclib.f90
index 14c59b0616f82..76071c2255a47 100644
--- a/flang/test/Driver/fveclib.f90
+++ b/flang/test/Driver/fveclib.f90
@@ -30,3 +30,20 @@
 
 ! TODO: if we add support for -nostdlib or -nodefaultlibs we need to test that
 ! these prevent "-framework Accelerate" being added on Darwin
+
+! Verify that the correct vector library is passed to LTO flags.
+
+! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fveclib=LIBMVEC -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-LIBMVEC %s
+! CHECK-LTO-LIBMVEC: "-plugin-opt=-vector-library=LIBMVEC-X86"
+
+! RUN: %flang -### --target=powerpc64-unknown-linux-gnu -fveclib=MASSV -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-MASSV %s
+! CHECK-LTO-MASSV: "-plugin-opt=-vector-library=MASSV"
+
+! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fveclib=SVML -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-SVML %s
+! CHECK-LTO-SVML: "-plugin-opt=-vector-library=SVML"
+
+! RUN: %flang -### --target=aarch64-linux-gnu -fveclib=SLEEF -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-SLEEF %s
+! CHECK-LTO-SLEEF: "-plugin-opt=-vector-library=sleefgnuabi"
+
+! RUN: %flang -### --target=aarch64-linux-gnu -fveclib=ArmPL -flto %s 2>&1 | FileCheck -check-prefix CHECK-LTO-ARMPL %s
+! CHECK-LTO-ARMPL: "-plugin-opt=-vector-library=ArmPL"



More information about the flang-commits mailing list