This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add -J and -module-dir to f18 driver
ClosedPublic

Authored by tskeith on Feb 21 2021, 2:40 PM.

Details

Summary

Add -J to the f18 driver for compatibility with gfortran.
Add -module-dir for compatibility with the new flang driver.

They both set the output directory for .mod files and add the
directory to the search list. -module still only does the former.

Diff Detail

Event Timeline

tskeith created this revision.Feb 21 2021, 2:40 PM
tskeith requested review of this revision.Feb 21 2021, 2:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2021, 2:40 PM
tskeith updated this revision to Diff 325368.Feb 21 2021, 8:47 PM

Remove f18 test from test/Flang-Driver/write-module.f90.
Clean up the rest of that test.

Thank you for submitting this Tim!

Would you mind adding the following in flang/test/Flang-Driver/write-module.f90 before merging? This way both -module-dir _and_ -J are tested.

! RUN: rm -rf %t && mkdir -p %t/dir-flang
! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
awarzynski accepted this revision.Feb 22 2021, 4:10 AM
This revision is now accepted and ready to land.Feb 22 2021, 4:10 AM
tskeith updated this revision to Diff 325463.Feb 22 2021, 9:00 AM

Bring new driver test in sync with f18 driver test.

Thank you for submitting this Tim!

Would you mind adding the following in flang/test/Flang-Driver/write-module.f90 before merging? This way both -module-dir _and_ -J are tested.

! RUN: rm -rf %t && mkdir -p %t/dir-flang
! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod

OK. I also added a test for -J without a space after it.

This revision was landed with ongoing or failed builds.Feb 22 2021, 9:04 AM
This revision was automatically updated to reflect the committed changes.
This comment was removed by sscalpone.