[PATCH] D87989: [Flang][Driver] Add InputOutputTest frontend action with new -test-IO flag

Caroline via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 11:13:20 PDT 2020


CarolineConcatto created this revision.
Herald added subscribers: cfe-commits, dang, mgorny.
Herald added a reviewer: DavidTruby.
Herald added a reviewer: sscalpone.
Herald added a project: clang.
CarolineConcatto requested review of this revision.

The sole purpose of this action is to read a file from the command line and
 print it either to stdout or the output file. This action runs by using the
`-test-IO` flag introduced in this patch:
`flang-new -test-IO` or `flang-new -fc1 -test-IO`

With this patch, `flang-new -test-IO input-file.f90` will read `input-file.f90` and
print it in the output file.

This action has been introduced to facilitate testing. It is hidden from users,
not being shown with `--help`.  It is visible with `--help-hidden`, and only
available for FlangOption and FC1Options in Option.td.

`-IO `is used to run the InputOutputTest action in the Flang frontend driver.
This patch makes sure that "flang-new" will forward it to "flang-new -fc1".
In Flang.cpp -test-IO is passed to "flang-new -fc1",  without `-E` so that the
preprocessor is _not_ run.

This patch introduces the dependencies required to read and manage input files
provided by the command line option. It also adds the structure to create and
write in output files.  The output is sent to either stdout or a file
(specified with -o output_file).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87989

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  clang/lib/Driver/Types.cpp
  flang/CMakeLists.txt
  flang/include/flang/Frontend/CompilerInstance.h
  flang/include/flang/Frontend/CompilerInvocation.h
  flang/include/flang/Frontend/FrontendAction.h
  flang/include/flang/Frontend/FrontendActions.h
  flang/include/flang/Frontend/FrontendOptions.h
  flang/include/flang/FrontendTool/Utils.h
  flang/lib/Frontend/CMakeLists.txt
  flang/lib/Frontend/CompilerInstance.cpp
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendAction.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/lib/Frontend/FrontendOptions.cpp
  flang/lib/FrontendTool/CMakeLists.txt
  flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  flang/test/Flang-Driver/driver-help-hidden.f90
  flang/test/Flang-Driver/emit-obj.f90
  flang/test/Frontend/Inputs/empty-file.f90
  flang/test/Frontend/input-output-file.f90
  flang/test/Frontend/multiple-input-files.f90
  flang/test/lit.cfg.py
  flang/tools/flang-driver/fc1_main.cpp
  flang/unittests/Frontend/CMakeLists.txt
  flang/unittests/Frontend/CompilerInstanceTest.cpp
  flang/unittests/Frontend/InputOutputTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87989.293022.patch
Type: text/x-patch
Size: 44775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200920/53d7d6e1/attachment-0001.bin>


More information about the cfe-commits mailing list