aboutsummaryrefslogtreecommitdiff
path: root/flang
AgeCommit message (Collapse)AuthorFilesLines
2021-01-26[flang][openacc][NFC] Organize clause validity tests by directiveValentin Clement24-1275/+1885
Split the tests from acc-clause-validity.f90 in dedicated files by directives. The file acc-clause-validity.f90 was getting too big to be correctly maintained. Tests are identical. Reviewed By: SouraVX Differential Revision: https://reviews.llvm.org/D95328
2021-01-26Revert "[flang] Search for #include "file" in right directory"Andrzej Warzynski8-48/+34
This reverts commit d987b61b1dce9948801ac37704477e7c257100b1. As pointed out in https://reviews.llvm.org/D95388, the reverted commit causes build failures in the following Flang buildbots: * http://lab.llvm.org:8011/#/builders/32/builds/2642 * http://lab.llvm.org:8011/#/builders/33/builds/2131 * http://lab.llvm.org:8011/#/builders/135/builds/1473 * http://lab.llvm.org:8011/#/builders/66/builds/1559 * http://lab.llvm.org:8011/#/builders/134/builds/1409 * http://lab.llvm.org:8011/#/builders/132/builds/1817 I'm guessing that the patch was only tested with `FLANG_BUILD_NEW_DRIVER=Off` (i.e. the default). The builders listed above set `FLANG_BUILD_NEW_DRIVER` to `On`. Although fixing the build is relatively easy, the reverted patch modifies the behaviour of the frontend, which breaks driver tests. In particular, in https://reviews.llvm.org/D93453 support for `-I` was added that depends on the current behaviour. The reverted patch changes that behaviour. Either the tests have to be updated or the change fine-tuned.
2021-01-25[flang] Fix errors in ISO_FORTRAN_ENV module for REAL128peter klausler1-2/+2
Some parameters of 128-bit IEEE floating-point numbers were incorrect, leading to a failure to define REAL128 to 16. Differential Revision: https://reviews.llvm.org/D95387
2021-01-25[flang] Search for #include "file" in right directorypeter klausler8-34/+48
Make the #include "file" preprocessing directive begin its search in the same directory as the file containing the directive, as other preprocessors and our Fortran INCLUDE statement do. Avoid current working directory for all source files after the original. Differential Revision: https://reviews.llvm.org/D95388
2021-01-25[flang][driver] Update PP tests to use the new driverFaris Rehman81-80/+85
Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805
2021-01-25[flang][driver] Remove newline in CompilerInvocationFaris Rehman1-2/+1
Remove a new line in CompilerInvocation, to now follow the style when clang-format is applied.
2021-01-22[flang][nfc] Fix comments, remove needless API, tweak scriptpeter klausler4-4/+8
* Remove an unimplemented and unused member function declaration * Remove a misleading comment about an unrelated constraint number * Fix a comment * Add f18 crash message to "flang" driver script Differential Revision: https://reviews.llvm.org/D95180
2021-01-22[flang] Correct shape analysis for transformational intrinsic functionspeter klausler2-32/+100
Correct the analysis of references to transformational intrinsic functions that have different semantics based on the presence or absence of a DIM= argument; add shape analysis for UNPACK(). Differential Revision: https://reviews.llvm.org/D94716
2021-01-22[flang] Remove some needless operations in expr rewritingpeter klausler3-13/+44
Expressions emitted to module files and error messages sometimes contain conversions of integer results of inquiry intrinsics; these are usually not needed, and can conflict with "int" in the user's namespace. Improve folding so that these conversions don't appear, and do some other clean-up in adjacent code. Differential Revision: https://reviews.llvm.org/D95172
2021-01-22[flang] Fix typo in error messagePeter Steinfeld2-4/+4
The title says it all. Differential Revision: https://reviews.llvm.org/D95233
2021-01-21[flang] Fix bogus error message with bindingpeter klausler4-22/+48
ProcedureDesignator::GetInterfaceSymbol() needs to return the procedure bound to a bindings. Differential Revision: https://reviews.llvm.org/D95178
2021-01-21[flang] Allow NULL() actual argument for pointer dummypeter klausler1-9/+13
Fixes a bogus error message about an actual argument not being an object. Differential Revision: https://reviews.llvm.org/D95176
2021-01-21[flang] Address name resolution problemspeter klausler1-3/+11
Don't emit a bogus error message about a bad forward reference when it's an IMPORT of a USE-associated symbol; don't ignore intrinsic functions when USE-associating the contents of a module when the intrinsic has been explicitly USE'd; allow PUBLIC or PRIVATE accessibility attribute to be specified for an enumerator before the declaration of the enumerator. Differential Revision: https://reviews.llvm.org/D95175
2021-01-21[flang] Better C_LOC and C_ASSOCIATED in flang/modulepeter klausler2-11/+31
The place-holding implementation of C_LOC just didn't work when used with our more complete semantic checking, specifically in the case of a polymorphic argument; convert it to an external function with an implicit interface. C_ASSOCIATED needs to be a generic interface with specific implementations for C_PTR and C_FUNPTR. Differential Revision: https://reviews.llvm.org/D94714
2021-01-21[flang][driver] Move fixed/free from detection out of FrontendAction APIAndrzej Warzynski3-13/+26
All Fortran options should be set in `CompilerInstance` (via its `CompilerInvocation`) before any of `FrontendAction` is entered - that's one of the tasks of the driver. However, this is a bit tricky with fixed and free from detection introduced in https://reviews.llvm.org/D94228. Fixed-free form detection needs to happen: * before any frontend action (we need to specify `isFixedForm` in `Fortran::parser::Options` before running any actions) * separately for every input file (we might be compiling multiple Fortran files, some in free form, some in fixed form) In other words, we need this to happen early (before any `FrontendAction`), but not too early (we need to know what the current input file is). In practice, `isFixedForm` can only be set later than other options (other options are inferred from compiler flags). So we can't really set all of them in one place, which is not ideal. All changes in this patch are NFCs (hence no new tests). Quick summary: * move fixed/free form detection from `FrontendAction::ExecuteAction` to `CompilerInstance::ExecuteAction` * add a bool flag in `FrontendInputFile` to mark a file as fixed/free form * updated a few comments Differential Revision: https://reviews.llvm.org/D95042
2021-01-21[flang][driver] Make the driver report diagnostics from the prescannerAndrzej Warzynski3-0/+14
This patch makes sure that diagnostics from the prescanner are reported when running `flang-new -E` (i.e. only the preprocessor phase is requested). More specifically, the `PrintPreprocessedAction` action is updated. With this patch we make sure that the `f18` and `flang-new` provide identical output when running the preprocessor and the prescanner generates diagnostics. Differential Revision: https://reviews.llvm.org/D94782
2021-01-20[flang] Fix creation of deferred shape arrays by POINTER statementPeter Steinfeld4-3/+32
It's possible to declare deferred shape array using the POINTER statement, for example: POINTER :: var(:) When analyzing POINTER declarations, we were not capturing the array specification information, if present. I fixed this by changing the "Post" function for "parser::PointerDecl" to check to see if the declaration contained a "DeferredShapeSpecList". In such cases, I analyzed the shape and used to information to declare an "ObjectEntity" that contains the shape information rather than an "UnknownEntity". I also added a couple of small tests that fail to compile without these changes. Differential Revision: https://reviews.llvm.org/D95080
2021-01-20[flang] Infrastructure improvements in utility routinespeter klausler8-22/+119
* IsArrayElement() needs another option to control whether it should ignore trailing component references. * Add IsObjectPointer(). * Add const Scope& variants of IsFunction() and IsProcedure(). * Make TypeAndShape::Characterize() work with procedure bindings. * Handle CHARACTER length in MeasureSizeInBytes(). * Fine-tune FindExternallyVisibleObject()'s handling of dummy arguments to conform with Fortran 2018: only INTENT(IN) and dummy pointers in pure functions signify; update two tests accordingly. Also: resolve some stylistic inconsistencies and add a missing "const" in the expression traversal template framework. Differential Revision: https://reviews.llvm.org/D95011
2021-01-20[flang][driver] Refactor one unit-test case to use fixtures (nfc)Andrzej Warzynski4-79/+28
Move the unit test from InputOutputTest.cpp to FrontendActionTest.cpp and re-implement it in terms of the FrontendActionTest fixture. This is just a small code clean-up and a continuation of: * https://reviews.llvm.org/D93544 Moving forward, we should try be implementing all unit-test cases for Flang's frontend actions in terms of FrontendActionTest. Reviewed By: sameeranjoshi Differential Revision: https://reviews.llvm.org/D94922
2021-01-20[flang] Fix ASSOCIATE statement name resolutionpeter klausler2-23/+54
F18 Clause 19.4p9 says: The associate names of an ASSOCIATE construct have the scope of the block. Clause 11.3.1p1 says the ASSOCIATE statement is not itself in the block: R1102 associate-construct is: associate-stmt block end-associate-stmt Associate statement associations are currently fully processed from left to right, incorrectly interposing associating entities earlier in the list on same-named entities in the host scope. 1 program p 2 logical :: a = .false. 3 real :: b = 9.73 4 associate (b => a, a => b) 5 print*, a, b 6 end associate 7 print*, a, b 8 end Associating names 'a' and 'b' at line 4 in this code are now both aliased to logical host entity 'a' at line 2. This happens because the reference to 'b' in the second association incorrectly resolves 'b' to the entity in line 4 (already associated to 'a' at line 2), rather than the 'b' at line 3. With bridge code to process these associations, f18 output is: F F F 9.73 It should be: 9.73 F F 9.73 To fix this, names in right-hand side selector variables/expressions must all be resolved before any left-hand side entities are resolved. This is done by maintaining a stack of lists of associations, rather than a stack of associations. Each ASSOCIATE statement's list of assocations is then visited once for right-hand side processing, and once for left-hand side processing. Note that other construct associations do not have this problem. SELECT RANK and SELECT TYPE each have a single assocation, not a list. Constraint C1113 prohibits the right-hand side of a CHANGE TEAM association from referencing any left-hand side entity. Differential Revision: https://reviews.llvm.org/D95010
2021-01-19[flang] Refine WhyNotModifiable()peter klausler5-15/+164
The utility routine WhyNotModifiable() needed to become more aware of the use of pointers in data-refs; the targets of pointer components are sometimes modifiable even when the leftmost ("base") symbol of a data-ref is not. Added a new unit test for WhyNotModifiable() that uses internal READ statements (mostly), since I/O semantic checking uses WhyNotModifiable() for all its definability checking. Differential Revision: https://reviews.llvm.org/D94849
2021-01-19[flang][driver] Move isFixedFormSuffix and isFreeFormSuffix to flangFrontendAndrzej Warzynski5-26/+24
isFixedFormSuffix and isFreeFormSuffix should be defined in flangFrontend rather than flangFrontendTool library. That's for 2 reasons: * these methods are used in flangFrontend rather than flangFrontendTool * flangFrontendTool depends on flangFrontend As mentioned in the post-commit review for D94228, without this change shared library builds fail. Differential Revision: https://reviews.llvm.org/D94968
2021-01-19[flang][directive] Get rid of flangClassValue in TableGenValentin Clement4-39/+27
The TableGen emitter for directives has two slots for flangClass information and this was mainly to be able to keep up with the legacy openmp parser at the time. Now that all clauses are encapsulated in AccClause or OmpClause, these two strings are not necessary anymore and were the the source of couple of problem while working with the generic structure checker for OpenMP. This patch remove the flangClassValue string from DirectiveBase.td and use the string flangClass as the placeholder for the encapsulated class. Reviewed By: sameeranjoshi Differential Revision: https://reviews.llvm.org/D94821
2021-01-19[CMake] Remove dead code setting policies to NEWRaul Tambre1-15/+1
cmake_minimum_required(VERSION) calls cmake_policy(VERSION), which sets all policies up to VERSION to NEW. LLVM started requiring CMake 3.13 last year, so we can remove a bunch of code setting policies prior to 3.13 to NEW as it no longer has any effect. Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D94374
2021-01-19[Flang][OpenMP] Add semantic checks for OpenMP Workshare ConstructPraveen7-12/+331
Add Semantic checks for OpenMP 4.5 - 2.7.4 Workshare Construct. - The structured block in a workshare construct may consist of only scalar or array assignments, forall or where statements, forall, where, atomic, critical or parallel constructs. - All array assignments, scalar assignments, and masked array assignments must be intrinsic assignments. - The construct must not contain any user defined function calls unless the function is ELEMENTAL. Test cases : omp-workshare03.f90, omp-workshare04.f90, omp-workshare05.f90 Resolve test cases (omp-workshare01.f90 and omp-workshare02.f90) marked as XFAIL Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D93091
2021-01-19[flang][driver] Add standard macro predefinitions for compiler versionFaris Rehman2-0/+39
Add the following standard predefinitions that f18 supports: * `__flang__`, * `__flang_major__`, * `__flang_minor__`, * `__flang_patchlevel__` Summary of changes: - Populate Fortran::parser::Options#predefinitions with the default supported predefinitions Differential Revision: https://reviews.llvm.org/D94516
2021-01-19[flang][driver] Add support for fixed form detectionFaris Rehman9-10/+84
Currently the new flang driver always runs in free form mode. This patch adds support for fixed form mode detection based on the file extensions. Like `f18`, `flang-new` will treat files ending with ".f", ".F" and ".ff" as fixed form. Additionally, ".for", ".FOR", ".fpp" and ".FPP" file extensions are recognised as fixed form files. This is consistent with gfortran [1]. In summary, files with the following extensions are treated as fixed-form: * ".f", ".F", ".ff", ".for", ".FOR", ".fpp", ".FPP" For consistency with flang/test/lit.cfg.py and f18, this patch also adds support for the following file extensions: * ".ff", ".FOR", ".for", ".ff90", ".fpp", ".FPP" This is added in flang/lib/Frontend/FrontendOptions.cpp. Additionally, the following extensions are included: * ".f03", ".F03", ".f08", ".F08" This is for compatibility with gfortran [1] and other popular Fortran compilers [2]. NOTE: internally Flang will only differentiate between fixed and free form files. Currently Flang does not support switching between language standards, so in this regard file extensions are irrelevant. More specifically, both `file.f03` and `file.f18` are represented with `Language::Fortran` (as opposed to e.g. `Language::Fortran03`). Summary of changes: - Set Fortran::parser::Options::sFixedForm according to the file type - Add isFixedFormSuffix and isFreeFormSuffix helper functions to FrontendTool/Utils.h - Change FrontendOptions::GetInputKindForExtension to support the missing file extensions that f18 supports and some additional ones - FrontendActionTest.cpp is updated to make sure that the test input is treated as free-form [1] https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-and-GCC.html [2] https://github.com/llvm/llvm-project/blob/master/flang/docs/OptionComparison.md#notes Differential Revision: https://reviews.llvm.org/D94228
2021-01-19[flang][driver] Add support for `-I` in the new driverFaris Rehman12-0/+132
Add support for option -I in the new Flang driver. This will allow for included headers and module files in other directories, as the default search path is currently the working folder. The behaviour of this is consistent with the current f18 driver, where the current folder (i.e. ".") has the highest priority followed by the order of '-I's taking priority from first to last. Summary of changes: - Add SearchDirectoriesFromDashI to PreprocessorOptions, to be forwarded into the parser's searchDirectories - Add header files and non-functional module files to be used in regression tests. The module files are just text files and are used to demonstrated that paths specified with `-I` are taken into account when searching for .mod files. Differential Revision: https://reviews.llvm.org/D93453
2021-01-15[flang] Create names to allow access to inaccessible specificspeter klausler9-21/+123
When a reference to a generic interface occurs in a specification expression that must be emitted to a module file, we have a problem when the generic resolves to a function whose name is inaccessible due to being PRIVATE or due to a conflict with another use of the same name in the scope. In these cases, construct a new name for the specific procedure and emit a renaming USE to the module file. Also, relax enforcement of PRIVATE when analyzing module files. Differential Revision: https://reviews.llvm.org/D94815
2021-01-15[flang][driver] Copy test file into a temp dir when testing (nfc)Andrzej Warzynski1-1/+5
The following driver invocation will generate an output file in 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 make sure that we don't pollute the source directory. To this end, copy the input file into a temporary directory before testing. This is similar to https://reviews.llvm.org/D94243.
2021-01-15[flang] Disallow INTENT attribute on procedure dummy argumentsPeter Steinfeld4-7/+22
C843 states that "An entity with the INTENT attribute shall be a dummy data object or a dummy procedure pointer." This change enforces that and fixes some tests that erroneously violated this rule. Differential Revision: https://reviews.llvm.org/D94781
2021-01-15Add Semantic check for Flang OpenMP 4.5 - 2.7.1 Do Loop restrictions on ↵Yashaswini7-23/+133
single directive and firstprivate clause. Semantic checks added to check the worksharing 'single' region closely nested inside a worksharing 'do' region. And also to check whether the 'do' iteration variable is a variable in 'Firstprivate' clause. Files: check-directive-structure.h check-omp-structure.h check-omp-structure.cpp Testcases: omp-do01-positivecase.f90 omp-do01.f90 omp-do05-positivecase.f90 omp-do05.f90 Reviewed by: Kiran Chandramohan @kiranchandramohan , Valentin Clement @clementval Differential Revision: https://reviews.llvm.org/D93205
2021-01-14[flang] Fix use-associated procedure in genericTim Keith3-12/+45
When a use-associated procedure was included in a generic, we weren't correctly recording that fact. The ultimate symbol was added rather than the local symbol. Also, improve the message emitted for the specific procedure by mentioning the module it came from. This fixes one of the problems in https://bugs.llvm.org/show_bug.cgi?id=48648. Differential Revision: https://reviews.llvm.org/D94696
2021-01-14[openacc] Rename generated file from ACC.cpp.inc to ACC.inc to match D92955Valentin Clement4-6/+6
This patch rename the tablegen generated file ACC.cpp.inc to ACC.inc in order to match what was done in D92955. This file is included in header file as well as .cpp file so it make more sense. Reviewed By: sameeranjoshi Differential Revision: https://reviews.llvm.org/D93485
2021-01-14[flang] Fix some module file issues exposed by Whizardpeter klausler4-27/+125
Generic type-bound interfaces for user-defined operators need to be formatted as "OPERATOR(.op.)", not just ".op." PRIVATE generics need to be marked as such. Declaration ordering: when a generic interface shadows a derived type of the same name, it needs to be emitted to the module file at the point of definition of the derived type; otherwise, the derived type's definition may appear after its first use. The module symbol for a module read from a module file needs to be marked as coming from a module file before semantic processing is performed on the contents of the module so that any special handling for declarations in module files can be properly activated. IMPORT statements were sometimes missing for use-associated symbols in surrounding scopes; fine-tune NeedImport(). Differential Revision: https://reviews.llvm.org/D94636
2021-01-14[flang][driver] Use __FLANG_VERISION__ in f18.cpp (nfc)Andrzej Warzynski1-2/+1
Just a minor improvement suggested in a post-commit review here: https://reviews.llvm.org/D94422
2021-01-14[flang] Fix dangling pointer in LabelEnforceTim Keith1-2/+2
`DirectiveStructureChecker` was passing in a pointer to a temporary string for the `construct` argument to the constructor for `LabelEnforce`. The `LabelEnforce` object had a lifetime longer than the temporary, resulting in accessing a dangling pointer when emitting an error message for `omp-parallell01.f90`. The fix is to make the lifetime of the temporary as long as the lifetime of the `LabelEnforce` object. Differential Revision: https://reviews.llvm.org/D94618
2021-01-14[flang][driver] Unify f18_version.h.in and Version.inc.inAndrzej Warzynski5-22/+12
Flang has two CMake configurable header files that define compiler version numbers: * f18_version.h.in - only used in f18.cpp (uses version numbers from LLVM's macro definitions) * Version.inc.in - not currently used (uses version numbers hard-coded in Flang's top CMake script) Currently only f18_version.h.in provides version numbers consistent with other subprojects in llvm-project. However, its location and name are inconsistent with e.g. Clang. This patch merges the two headers together: * hard-coded version numbers in Flang's top CMake script are deleted * Version.inc.in is updated to provide string versions of version numbers (required by f18.cpp) * f18_version.h.in is deleted as it's no longer needed Differential Revision: https://reviews.llvm.org/D94422
2021-01-13[flang] Add tests for procedure arguments with implicit interfacesPeter Steinfeld2-7/+30
It's possible to declare an external procedure and then pass it as an actual argument to a subprogram expecting a procedure argument. I added tests for this and added an error message to distinguish passing an actual argument with an implicit interface from passing an argument with a mismatched explicit interface. Differential Revision: https://reviews.llvm.org/D94505
2021-01-13[flang] Fix accessibility of USEd name in .mod fileTim Keith2-0/+19
If a module specifies default private accessibility, names that have been use-associated are private by default. This was not reflected in .mod files. Differential Revision: https://reviews.llvm.org/D94602
2021-01-13[flang] Do not create HostAssoc symbols in derived type scopespeter klausler1-1/+3
When needed due to a specification expression in a derived type, the host association symbols should be created in the surrounding subprogram's scope instead. Differential Revision: https://reviews.llvm.org/D94567
2021-01-13[flang] Fix classification of shape inquiries in specification exprspeter klausler21-383/+562
In some contexts, including the motivating case of determining whether the expressions that define the shape of a variable are "constant expressions" in the sense of the Fortran standard, expression rewriting via Fold() is not necessary, and should not be required. The inquiry intrinsics LBOUND, UBOUND, and SIZE work correctly now in specification expressions and are classified correctly as being constant expressions (or not). Getting this right led to a fair amount of API clean-up as a consequence, including the folding of shapes and TypeAndShape objects, and new APIs for shapes that do not fold for those cases where folding isn't needed. Further, the symbol-testing predicate APIs in Evaluate/tools.h now all resolve any associations of their symbols and work transparently on use-, host-, and construct-association symbols; the tools used to resolve those associations have been defined and documented more precisely, and their clients adjusted as needed. Differential Revision: https://reviews.llvm.org/D94561
2021-01-13[Flang][openmp][openacc] Extend CheckNoBranching to handle branching ↵sameeran joshi3-11/+16
provided by LabelEnforce. `CheckNoBranching` is currently handling only illegal branching out for constructs with `Parser::Name` in them. Extend the same for handling illegal branching out caused by `Parser::Label` based statements. This patch could possibly solve one of the issues(typically branching out) mentioned in D92735. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D93447
2021-01-11[flang][openxx][NFC] Remove duplicated function to check required clausesValentin Clement3-16/+4
Remove duplicated function to check for required clauses on a directive. This was still there from the merging of OpenACC and OpenMP common semantic checks and it can now be removed so we use only one function. Reviewed By: sameeranjoshi Differential Revision: https://reviews.llvm.org/D93575
2021-01-11[flang][driver] Copy input files into a temp dir when testingAndrzej Warzynski1-3/+7
The following frontend driver invocation will generate 2 output files in 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 make sure that we don't pollute the source directory. To this end, copy test input files into a temporary directory. Differential Revision: https://reviews.llvm.org/D94243
2021-01-08[flang] Fix bogus message on internal subprogram with alternate returnPeter Steinfeld8-23/+60
Internal subprograms have explicit interfaces. If an internal subprogram has an alternate return, we check its explicit interface. But we were not putting the label values of alternate returns into the actual argument. I fixed this by changing the definition of actual arguments to be able to contain a common::Label and putting the label for an alternate return into the actual argument. I also verified that we were already doing all of the semantic checking required for alternate returns and removed a "TODO" for this. I also added the test altreturn06.f90. Differential Revision: https://reviews.llvm.org/D94017
2021-01-07[flang][openacc] Enforce delcare directive restrictionValentin Clement4-4/+159
Add semantic check for most of the restrictions for the declare directive. Reviewed By: kiranktp Differential Revision: https://reviews.llvm.org/D92741
2021-01-07[flang][driver] Rename driver tests (nfc)Andrzej Warzynski4-0/+0
As per [1]: ``` File names should use dashes, not underscores. ``` This patch updates the names of Flang driver tests accordingly. [1] https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md
2021-01-07[flang][driver] Add support for `-c` and `-emit-obj`Andrzej Warzynski10-15/+57
This patch adds a frontend action for emitting object files. While Flang does not support code-generation, this action remains a placeholder. This patch simply provides glue-code to connect the compiler driver with the appropriate frontend action. The new action is triggered with the `-c` compiler driver flag, i.e. `flang-new -c`. This is then translated to `flang-new -fc1 -emit-obj`, so `-emit-obj` has to be marked as supported as well. As code-generation is not available yet, `flang-new -c` results in a driver error: ``` error: code-generation is not available yet ``` Hopefully this will help communicating the level of available functionality within Flang. The definition of `emit-obj` is updated so that it can be shared between Clang and Flang. As the original definition was enclosed within a Clang-specific TableGen `let` statement, it is extracted into a new `let` statement. That felt like the cleanest option. I also commented out `-triple` in Flang::ConstructJob and updated some comments there. This is similar to https://reviews.llvm.org/D93027. I wanted to make sure that it's clear that we can't support `-triple` until we have code-generation. However, once code-generation is available we _will need_ `-triple`. As this patch adds `-emit-obj`, the emit-obj.f90 becomes irrelevant and is deleted. Instead, phases.f90 is added to demonstrate that users can control compilation phases (indeed, `-c` is a phase control flag). Reviewed By: SouraVX, clementval Differential Revision: https://reviews.llvm.org/D93301
2021-01-06[flang][openacc] Add more parsing/sema tests for init and shutdown directivesValentin Clement1-0/+28
This patch adds some positive and failure tests for init and shutdown directives. Reviewed By: kiranktp Differential Revision: https://reviews.llvm.org/D90786