[flang-commits] [clang] [flang] [Flang][Driver] Add per-target search path for modules (PR #196558)

Michael Kruse via flang-commits flang-commits at lists.llvm.org
Wed May 13 06:58:57 PDT 2026


================
@@ -0,0 +1,58 @@
+! Ensure argument -fintrinsic-modules-path works as expected.
+
+!-----------------------------------------
+! FLANG DRIVER
+!-----------------------------------------
+! NOTE: Depending on how Flang is built, the default intrinsics may have higher
+!       or lower priority than -fintrinsic-modules-path added here. Using
+!       basictestmoduleone.mod from Inputs/module-dir/ will trigger an error.
+
+! RUN:     %flang -fsyntax-only --target=x86_64-unknown-linux-gnu -resource-dir %S/Inputs/resource_dir_with_per_target_subdir %s -### 2>&1 | FileCheck %s --check-prefix=DEFAULTPATH
+
+! RUN:     %flang -fsyntax-only --target=x86_64-unknown-linux-gnu -resource-dir %S/Inputs/resource_dir_with_per_target_subdir %s -cpp -DINTRINSICS_DEFAULT
----------------
Meinersbur wrote:

It is `--allow-empty`, not `--expect-empty`. lit tests are testing the presence of something, not its absence. For instance, if there any `CHECK:` lines, it does not check that there is no output before or after that. `-NOT` exists but is very fragile and should be avoided. LLVM tests are intentionally structured to not break when printing additonal lines. Imaging how many tests would need to be updated with messages such as `flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]`.

`RUN:` does return error code 0, which is checked by lit itself. 

https://github.com/llvm/llvm-project/pull/196558


More information about the flang-commits mailing list