[flang][test] Remove RUN COMMAND/EXPECTED OUTPUT/INPUT markers from other directories
[flang] Distinguish usage and portability warning messagesUsing recently established message severity codes, upgradenon-fatal messages to usage and portability warnings asappropriate.Differenti
[flang] Distinguish usage and portability warning messagesUsing recently established message severity codes, upgradenon-fatal messages to usage and portability warnings asappropriate.Differential Revision: https://reviews.llvm.org/D121246
show more ...
[flang] Make the frontend driver error out when requesting multiple actionsWith this change, the following invocations will be treated as errors(multiple actions are specified):```$ flang-new -f
[flang] Make the frontend driver error out when requesting multiple actionsWith this change, the following invocations will be treated as errors(multiple actions are specified):```$ flang-new -fc1 -E -fsyntax-only file.95$ flang-new -fc1 -fsyntax-only -fdebug-dump-symbols file.95```In the examples above it is not clear whether it is `-fsyntax-only` orthe other action that is run (i.e. `-E` or `-fdebug-dump-symbols`). Itmakes sense to disallow such usage. This should also lead to cleaner andclearer tests (the `RUN` lines using `%flang_fc1` will only allow oneaction).This change means that `flang-new -fc1` and `clang -cc1` will behavedifferently when multiple action options are specified. As frontenddrivers are mostly used by compiler developers, this shouldn't affect orconfuse the compiler end-users. Also, `flang-new` and `clang` remainconsistent.Tests are updated accordingly. More specifically, I've made sure thatevery test specifies only one action. I've also taken the opportunity tosimplify "multiple-input-files.f90" a bit.Differential Revision: https://reviews.llvm.org/D111781
[flang][nfc] Remove `flang-new-driver` from LITAfter merging https://reviews.llvm.org/D105811, `flang-new-driver` is nolonger required.Differential Revision: https://reviews.llvm.org/D107990
[flang][driver] Remove `%flang-new` from the LIT configuration`%flang-new` was introduced in the early days of the new driver to makea clear distinction between the tests for the current and the n
[flang][driver] Remove `%flang-new` from the LIT configuration`%flang-new` was introduced in the early days of the new driver to makea clear distinction between the tests for the current and the newdriver. We have since introduced `%flang` (compiler driver) and`%flang_fc1` (frontend driver) as the long term solution. This has allowedus to share tests between `flang-new` and `f18`. This patch replacesall uses of `%flang-new` with `%flang` and `%flang_fc1`.Some tests are reformatted so that all tests look uniform and are easierto follow. Where possible, `! REQUIRES: new-flang-driver` is deleted sothat more tests can be shared with `f18`. To facilitate this,`f{no-}implicit-none` are introduced in `f18` with semantics identicalto `flang-new`.Two tests are deleted rather than updated: * flang/test/Frontend/print-preprocess-C-file.f90 * flang/test/Frontend/print-preprocessed-file.f90Instead, there is plenty of preprocessor tests inflang/test/Preprocessing/.Differential Revision: https://reviews.llvm.org/D100174
[flang][test] Share all driver test dirs between `f18` and `flang-new`Originally, when we added the new driver, we created dedicated testdirectories for `flang-new`. This way we separated the test
[flang][test] Share all driver test dirs between `f18` and `flang-new`Originally, when we added the new driver, we created dedicated testdirectories for `flang-new`. This way we separated the tests for the`throwaway` and the new driver.As we are increasing test coverage and starting to share tests betweenthe two drivers, it makes sense to share all directories and insteadrely on:```! REQUIRES: new-flang-driver```to mark tests as exclusively for the new driver.Differential Revision: https://reviews.llvm.org/D97207
[flang][driver] Add -Xflang and make -test-io a frontend-only flangThis patch adds support for `-Xflang` in `flang-new`. The semantics areidentical to `-Xclang`.With the addition of `-Xflang`, w
[flang][driver] Add -Xflang and make -test-io a frontend-only flangThis patch adds support for `-Xflang` in `flang-new`. The semantics areidentical to `-Xclang`.With the addition of `-Xflang`, we can modify `-test-io` to be acompiler-frontend only flag. This makes more sense, this flag is: * very frontend specific * to be used for development and testing only * not to be exposed to the end userOriginally we added it to the compiler driver, `flang-new`, in order tofacilitate testing. With `-Xflang` this is no longer needed. Tests areupdated accordingly.Differential Revision: https://reviews.llvm.org/D96864
[flang] Add -fsyntax-only to f18; retain -fparse-only synonymNow that semantics is working, the standard -fsyntax-only option ofGNU and Clang should be used as the name of the option that causesf
[flang] Add -fsyntax-only to f18; retain -fparse-only synonymNow that semantics is working, the standard -fsyntax-only option ofGNU and Clang should be used as the name of the option that causesf18 to just run the front-end. Support both options in f18, silentlyaccepting the old option as a synonym for the new one (aspreferred by the code owner), and replace all instances of theold -fparse-only option with -fsyntax-only throughout the source base.Differential Revision: https://reviews.llvm.org/D95887
[flang][driver] Report prescanning diags during syntax-only parsingEnsure diagnostics from the prescanner are reported when running `flang-new -fsyntax-only` (i.e. only syntax parsing).This keeps
[flang][driver] Report prescanning diags during syntax-only parsingEnsure diagnostics from the prescanner are reported when running `flang-new -fsyntax-only` (i.e. only syntax parsing).This keeps the diagnostics output of flang-new consistent with `f18 -fparse-only` when running the syntax parsing action, ParseSyntaxOnlyAction.Summary of changes:- Modify ParseSyntaxOnlyAction::ExecuteAction to report diagnosticsDifferential Revision: https://reviews.llvm.org/D95220
[flang][driver] Make the driver report diagnostics from the prescannerThis patch makes sure that diagnostics from the prescanner are reportedwhen running `flang-new -E` (i.e. only the preprocessor
[flang][driver] Make the driver report diagnostics from the prescannerThis patch makes sure that diagnostics from the prescanner are reportedwhen running `flang-new -E` (i.e. only the preprocessor phase isrequested). More specifically, the `PrintPreprocessedAction` action isupdated.With this patch we make sure that the `f18` and `flang-new` provideidentical output when running the preprocessor and the prescannergenerates diagnostics.Differential Revision: https://reviews.llvm.org/D94782
[flang][driver] Copy test file into a temp dir when testing (nfc)The following driver invocation will generate an output filein the same directory as the input file:```flang-new -fc1 -test-io t
[flang][driver] Copy test file into a temp dir when testing (nfc)The following driver invocation will generate an output filein the same directory as the input file:```flang-new -fc1 -test-io test-input.f90```This is the desired behaviour. However, when testing we need to makesure that we don't pollute the source directory. To this end, copy theinput file into a temporary directory before testing.This is similar to https://reviews.llvm.org/D94243.
[flang][driver] Copy input files into a temp dir when testingThe following frontend driver invocation will generate 2 output filesin the same directory as the input files:```flang-new -fc1 input
[flang][driver] Copy input files into a temp dir when testingThe following frontend driver invocation will generate 2 output filesin the same directory as the input files:```flang-new -fc1 input-1.f input-2.f```This is the desired behaviour. However, when testing we need to makesure that we don't pollute the source directory. To this end, copy testinput files into a temporary directory.Differential Revision: https://reviews.llvm.org/D94243
[flang][driver] Fix formatting in a test (nfc)
[Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`)This patch implements the first frontend action for the Flang parser (i.e.Fortran::parser). This action runs the preproces
[Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`)This patch implements the first frontend action for the Flang parser (i.e.Fortran::parser). This action runs the preprocessor and is invoked with the`-E` flag. (i.e. `flang-new -E <input-file>). The generated output is printedto either stdout or the output file (specified with `-` or `-o <output-file>`).Note that currently there is no mechanism to map options for thefrontend driver (i.e. Fortran::frontend::FrontendOptions) to options forthe parser (i.e. Fortran::parser::Options). Instead,Frotran::parser::options are hard-coded to:```std::vector<std::string> searchDirectories{"."s};searchDirectories = searchDirectories;isFixedForm = false;_encoding(Fortran::parser::Encoding::UTF_8);```These default settings are compatible with the current Flang driver. Furtherwork is required in order for CompilerInvocation to read and mapclang::driver::options to Fortran::parser::options.Co-authored-by: Andrzej Warzynski <[email protected]>Differential Revision: https://reviews.llvm.org/D88381
[flang][driver] Use --match-full-lines in tests for `-test-io`Use `--match-full-lines` to make sure that FileCheck doesn't match theoutput against the `CHECK` lines (which, like other comments, ar
[flang][driver] Use --match-full-lines in tests for `-test-io`Use `--match-full-lines` to make sure that FileCheck doesn't match theoutput against the `CHECK` lines (which, like other comments, are alsoprinted).More specifically, we want to make sure that the following `check` in theinput file:```! CHECK: <some-fortran-input>```is matched by FileCheck with `<some-fortran-input>` in the generatedoutput. Without `--match-full-lines`, that check-line will be matchedwith `!CHECK: <some-fortran-input>` instead (which is alsoprinted together with other contents of the file).Adding `--match-full-lines` makes the tests stricter and this changerevealed that some `check`s were passing only because that flag wasmissing. These are updated accordingly.Reviewed By: CarolineConcatto, sameeranjoshiDifferential Revision: https://reviews.llvm.org/D90306
[Flang][Driver] Add infrastructure for basic frontend actions and file I/OThis patch introduces the dependencies required to read and manage input filesprovided by the command line option. It also
[Flang][Driver] Add infrastructure for basic frontend actions and file I/OThis patch introduces the dependencies required to read and manage input filesprovided by the command line option. It also adds the infrastructure to createand write to output files. The output is sent to either stdout or a file(specified with the `-o` flag).Separately, in order to be able to test the code for file I/O, it addsinfrastructure to create frontend actions. As a basic testable example, it addsthe `InputOutputTest` FrontendAction. The sole purpose of this action is toread a file from the command line and print it either to stdout or the outputfile. This action is run by using the `-test-io` flag also introduced in thispatch (available for `flang-new` and `flang-new -fc1`). With this patch:```flang-new -test-io input-file.f90```will read input-file.f90 and print it in the output file.The `InputOutputTest` frontend action has been introduced primarily tofacilitate testing. It is hidden from users (i.e. it's only displayed with`--help-hidden`). Currently Clang doesn’t have an equivalent action.`-test-io` is used to trigger the InputOutputTest action in the Flang frontenddriver. This patch makes sure that “flang-new” forwards it to “flang-new -fc1"by creating a preprocessor job. However, in Flang.cpp, `-test-io` is passed to“flang-new -fc1” without `-E`. This way we make sure that the preprocessor is_not_ run in the frontend driver. This is the desired behaviour: `-test-io`should only read the input file and print it to the output stream.co-authored-by: Andrzej Warzynski <[email protected]>Differential Revision: https://reviews.llvm.org/D87989