[PATCH] D95448: [flang][driver] Add support for `-J/-module-dir`

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 1 06:02:20 PST 2021


awarzynski added inline comments.


================
Comment at: flang/test/Flang-Driver/include-module.f90:15
+! RUN: not %flang-new -fsyntax-only -module-dir %S/Inputs %s  2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
+! RUN: not %flang-new -fsyntax-only -J %S/Inputs/module-dir -J %S/Inputs/ %s  2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
+! RUN: not %flang-new -fsyntax-only -J %S/Inputs/module-dir -module-dir %S/Inputs/ %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
----------------
awarzynski wrote:
> Why `--check-prefix=SINGLEINCLUDE` here and below? Both directories are included, so there should be no errors.
Apologies, I was wrong with regard to how `-J/-module-dir` should work:

```
$ gfortran -J test-dir/ -J test-dir/ test.f
f951: Fatal Error: gfortran: Only one ā€˜-Jā€™ option allowed
compilation terminated.
```

`gfortran` behavior makes a lot of sense to me and I suggest that we replicate that. This means that we should issue a diagnostic when `-J/-module-dir` is used twice.


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

https://reviews.llvm.org/D95448



More information about the cfe-commits mailing list