[flang-commits] [flang] [flang][bbc] Add support for -ffintrinsic-modules-path (PR #196651)

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Fri May 8 14:55:10 PDT 2026


https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/196651

Corresponds to the flag of the same name of the flang driver/frontend.

>From 1352c266efe446a45789807f3e99350a538bbd5b Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Fri, 8 May 2026 22:37:55 +0200
Subject: [PATCH] Revert "Outstract bbc changes"

This reverts commit 0b60113361a94e25c9df2b2021510ca30ad9ae1f.
---
 flang/test/Driver/intrinsic-module-path_bbc.f90 | 12 ++++++++++++
 flang/tools/bbc/bbc.cpp                         |  5 +++++
 2 files changed, 17 insertions(+)
 create mode 100644 flang/test/Driver/intrinsic-module-path_bbc.f90

diff --git a/flang/test/Driver/intrinsic-module-path_bbc.f90 b/flang/test/Driver/intrinsic-module-path_bbc.f90
new file mode 100644
index 0000000000000..ad41e69b9fec0
--- /dev/null
+++ b/flang/test/Driver/intrinsic-module-path_bbc.f90
@@ -0,0 +1,12 @@
+! Ensure argument -fintrinsic-modules-path works as expected.
+
+! RUN: not bbc %s -fintrinsic-modules-path=%S/Inputs/module-dir/ -fintrinsic-modules-path=%S/Inputs/module-dir-one/ 2>&1 | FileCheck %s --check-prefix=WRONGINPUTONE
+
+! WRONGINPUTONE: 't1' not found in module 'basictestmoduleone'
+
+program test_intrinsic_module_path
+   use ieee_arithmetic, only: ieee_round_type
+   use iso_fortran_env, only: team_type, event_type, lock_type
+   use basictestmoduleone, only: t1
+   use basictestmoduletwo, only: t2
+end program
diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp
index a21865f9c5ffe..227f09a4d0367 100644
--- a/flang/tools/bbc/bbc.cpp
+++ b/flang/tools/bbc/bbc.cpp
@@ -100,6 +100,11 @@ static llvm::cl::alias
                           llvm::cl::desc("intrinsic module directory"),
                           llvm::cl::aliasopt(intrinsicIncludeDirs));
 
+static llvm::cl::alias
+    intrinsicModulePath("fintrinsic-modules-path",
+                        llvm::cl::desc("intrinsic module search paths"),
+                        llvm::cl::aliasopt(intrinsicIncludeDirs));
+
 static llvm::cl::opt<std::string>
     moduleDir("module", llvm::cl::desc("module output directory (default .)"),
               llvm::cl::init("."));



More information about the flang-commits mailing list