[flang-commits] [flang] [clang] [flang] Fix fveclib on Darwin (PR #77605)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Wed Jan 10 06:01:35 PST 2024


https://github.com/luporl updated https://github.com/llvm/llvm-project/pull/77605

>From 3e165d363b6211e4625056671d548037533ed819 Mon Sep 17 00:00:00 2001
From: Leandro Lupori <leandro.lupori at linaro.org>
Date: Wed, 10 Jan 2024 10:24:52 -0300
Subject: [PATCH 1/2] [flang] Fix fveclib on Darwin

Fixes fveclib.f90 and fveclib-codegen.f90 tests, that were failing
on Darwin.
---
 clang/lib/Driver/ToolChains/Flang.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp
index 41eaad3bbad0a3..3de5cf946bc9a8 100644
--- a/clang/lib/Driver/ToolChains/Flang.cpp
+++ b/clang/lib/Driver/ToolChains/Flang.cpp
@@ -352,12 +352,10 @@ void Flang::addTargetOptions(const ArgList &Args,
         if (A->getValue() == StringRef{"Accelerate"}) {
           CmdArgs.push_back("-framework");
           CmdArgs.push_back("Accelerate");
-          A->render(Args, CmdArgs);
         }
       }
-    } else {
-      A->render(Args, CmdArgs);
     }
+    A->render(Args, CmdArgs);
   }
 
   if (Triple.isKnownWindowsMSVCEnvironment()) {

>From 76f70a21bec0fbec6bb57fa73b44f2035b6e78c2 Mon Sep 17 00:00:00 2001
From: Leandro Lupori <leandro.lupori at linaro.org>
Date: Wed, 10 Jan 2024 10:58:42 -0300
Subject: [PATCH 2/2] Test -fveclib on Darwin

---
 flang/test/Driver/fveclib.f90 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/flang/test/Driver/fveclib.f90 b/flang/test/Driver/fveclib.f90
index 898c65b0c850af..14c59b0616f828 100644
--- a/flang/test/Driver/fveclib.f90
+++ b/flang/test/Driver/fveclib.f90
@@ -5,6 +5,7 @@
 ! RUN: %flang -### -c -fveclib=Darwin_libsystem_m %s 2>&1 | FileCheck -check-prefix CHECK-DARWIN_LIBSYSTEM_M %s
 ! RUN: %flang -### -c --target=aarch64-none-none -fveclib=SLEEF %s 2>&1 | FileCheck -check-prefix CHECK-SLEEF %s
 ! RUN: %flang -### -c --target=aarch64-none-none -fveclib=ArmPL %s 2>&1 | FileCheck -check-prefix CHECK-ARMPL %s
+! RUN: %flang -### -c --target=aarch64-apple-darwin -fveclib=none %s 2>&1 | FileCheck -check-prefix CHECK-NOLIB-DARWIN %s
 ! RUN: not %flang -c -fveclib=something %s 2>&1 | FileCheck -check-prefix CHECK-INVALID %s
 
 ! CHECK-NOLIB: "-fveclib=none"
@@ -14,6 +15,7 @@
 ! CHECK-DARWIN_LIBSYSTEM_M: "-fveclib=Darwin_libsystem_m"
 ! CHECK-SLEEF: "-fveclib=SLEEF"
 ! CHECK-ARMPL: "-fveclib=ArmPL"
+! CHECK-NOLIB-DARWIN: "-fveclib=none"
 
 ! CHECK-INVALID: error: invalid value 'something' in '-fveclib=something'
 



More information about the flang-commits mailing list