[PATCH] D97197: [flang][driver] Refine tests for module search directories

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 10:31:57 PST 2021


awarzynski marked 2 inline comments as done.
awarzynski added a comment.

In D97197#2579141 <https://reviews.llvm.org/D97197#2579141>, @tskeith wrote:

>> make sure that f18 is tested when FLANG_BUILD_NEW_DRIVER is set to Off
>
> I don't think any of the tests in `flang/test/Flang-Driver` are run when that flag is Off, due to the configuration in `flang/test/lit.cfg.py`. That's why I added `flang/test/Driver/write-module.f90` in D97164 <https://reviews.llvm.org/D97164>. Those tests are run in either configuration.

I assumed that the reason for a separate file in D97164 <https://reviews.llvm.org/D97164> was `-module` and `-fparse-only` (which are not available in the new driver). I should've asked. I think this is all fine and is a good indicator that it's time to update flang/test/lit.cfg.py: https://reviews.llvm.org/D97207.



================
Comment at: flang/test/Flang-Driver/Inputs/module-dir/basictestmoduleone.mod:3
 module basictestmoduleone
-type::t2
-end type
 end
----------------
tskeith wrote:
> Rather than check in the `.mod` files (whose format can change at any time) it would be better to check in the Fortran source and compile it for tests that need it. It would make the tests less fragile.
I agree that we should aim for something more reliable/stable. Could that be a separate patch though?


================
Comment at: flang/test/Flang-Driver/use-module-error.f90:8
+!--------------------------
+! RUN: not %flang-new -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s  2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE
+! RUN: not %flang-new -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=DOUBLEINCLUDE
----------------
tskeith wrote:
> For tests like this that require the new driver, it would be better to use `%flang` rather than `%flang-new`. Otherwise in ten years it will still say `%flang-new` and people will wonder what's new about it.
Old habits. Updated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97197/new/

https://reviews.llvm.org/D97197



More information about the llvm-commits mailing list