2020-10-24 19:33:19 +08:00
|
|
|
! REQUIRES: new-flang-driver
|
|
|
|
|
|
|
|
!--------------------------
|
|
|
|
! FLANG DRIVER (flang-new)
|
|
|
|
!--------------------------
|
2020-10-06 00:42:00 +08:00
|
|
|
! RUN: %flang-new -help 2>&1 | FileCheck %s --check-prefix=HELP
|
2020-09-11 17:17:31 +08:00
|
|
|
! RUN: not %flang-new -helps 2>&1 | FileCheck %s --check-prefix=ERROR
|
|
|
|
|
2020-10-24 19:33:19 +08:00
|
|
|
!----------------------------------------
|
|
|
|
! FLANG FRONTEND DRIVER (flang-new -fc1)
|
|
|
|
!----------------------------------------
|
|
|
|
! RUN: %flang-new -fc1 -help 2>&1 | FileCheck %s --check-prefix=HELP-FC1
|
|
|
|
! RUN: not %flang-new -fc1 -helps 2>&1 | FileCheck %s --check-prefix=ERROR
|
2020-09-11 17:17:31 +08:00
|
|
|
|
2020-10-27 20:26:47 +08:00
|
|
|
!----------------------------------------------------
|
|
|
|
! EXPECTED OUTPUT FOR FLANG DRIVER (flang-new)
|
|
|
|
!----------------------------------------------------
|
2020-10-06 00:42:00 +08:00
|
|
|
! HELP:USAGE: flang-new
|
|
|
|
! HELP-EMPTY:
|
|
|
|
! HELP-NEXT:OPTIONS:
|
2020-11-11 16:45:54 +08:00
|
|
|
! HELP-NEXT: -### Print (but do not run) the commands to run for this compilation
|
[flang][driver] Add support for `-c` and `-emit-obj`
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-07 17:08:54 +08:00
|
|
|
! HELP-NEXT: -c Only run preprocess, compile, and assemble steps
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-NEXT: -D <macro>=<value> Define <macro> to <value> (or 1 if <value> omitted)
|
2020-10-27 20:26:47 +08:00
|
|
|
! HELP-NEXT: -E Only run the preprocessor
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-NEXT: -falternative-parameter-statement
|
|
|
|
! HELP-NEXT: Enable the old style PARAMETER statement
|
|
|
|
! HELP-NEXT: -fbackslash Specify that backslash in string introduces an escape character
|
2020-10-06 00:42:00 +08:00
|
|
|
! HELP-NEXT: -fcolor-diagnostics Enable colors in diagnostics
|
2021-03-04 00:28:11 +08:00
|
|
|
! HELP-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type
|
|
|
|
! HELP-NEXT: -fdefault-integer-8 Set the default integer kind to an 8 byte wide type
|
|
|
|
! HELP-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type
|
2021-01-27 00:27:30 +08:00
|
|
|
! HELP-NEXT: -ffixed-form Process source files in fixed form
|
|
|
|
! HELP-NEXT: -ffixed-line-length=<value>
|
|
|
|
! HELP-NEXT: Use <value> as character line width in fixed mode
|
|
|
|
! HELP-NEXT: -ffree-form Process source files in free form
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements
|
|
|
|
! HELP-NEXT: -finput-charset=<value> Specify the default character set for source files
|
2021-03-04 00:28:11 +08:00
|
|
|
! HELP-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-NEXT: -flogical-abbreviations Enable logical abbreviations
|
2020-10-06 00:42:00 +08:00
|
|
|
! HELP-NEXT: -fno-color-diagnostics Disable colors in diagnostics
|
2021-02-10 17:24:45 +08:00
|
|
|
! HELP-NEXT: -fopenacc Enable OpenACC
|
|
|
|
! HELP-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code.
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV.
|
2020-10-24 19:33:19 +08:00
|
|
|
! HELP-NEXT: -help Display available options
|
2021-01-19 18:01:38 +08:00
|
|
|
! HELP-NEXT: -I <dir> Add directory to the end of the list of include search paths
|
2021-02-05 00:13:04 +08:00
|
|
|
! HELP-NEXT: -module-dir <dir> Put MODULE files in <dir>
|
2020-10-24 19:33:19 +08:00
|
|
|
! HELP-NEXT: -o <file> Write output to <file>
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-NEXT: -U <macro> Undefine macro <macro>
|
2020-10-24 19:33:19 +08:00
|
|
|
! HELP-NEXT: --version Print version information
|
2021-02-17 22:13:29 +08:00
|
|
|
! HELP-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
|
2020-09-11 17:17:31 +08:00
|
|
|
|
2020-10-27 20:26:47 +08:00
|
|
|
!-------------------------------------------------------------
|
|
|
|
! EXPECTED OUTPUT FOR FLANG FRONTEND DRIVER (flang-new -fc1)
|
|
|
|
!-------------------------------------------------------------
|
2020-10-06 00:42:00 +08:00
|
|
|
! HELP-FC1:USAGE: flang-new
|
|
|
|
! HELP-FC1-EMPTY:
|
|
|
|
! HELP-FC1-NEXT:OPTIONS:
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-FC1-NEXT: -D <macro>=<value> Define <macro> to <value> (or 1 if <value> omitted)
|
[flang][driver] Add support for `-c` and `-emit-obj`
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-07 17:08:54 +08:00
|
|
|
! HELP-FC1-NEXT: -emit-obj Emit native object files
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-FC1-NEXT: -E Only run the preprocessor
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-FC1-NEXT: -falternative-parameter-statement
|
|
|
|
! HELP-FC1-NEXT: Enable the old style PARAMETER statement
|
|
|
|
! HELP-FC1-NEXT: -fbackslash Specify that backslash in string introduces an escape character
|
2021-02-17 23:55:56 +08:00
|
|
|
! HELP-FC1-NEXT: -fdebug-dump-parse-tree Dump the parse tree
|
2021-02-24 01:59:17 +08:00
|
|
|
! HELP-FC1-NEXT: -fdebug-dump-parsing-log
|
|
|
|
! HELP-FC1-NEXT: Run instrumented parse and dump the parsing log
|
2021-02-17 23:55:56 +08:00
|
|
|
! HELP-FC1-NEXT: -fdebug-dump-provenance Dump provenance
|
|
|
|
! HELP-FC1-NEXT: -fdebug-dump-symbols Dump symbols after the semantic analysis
|
2021-02-18 02:53:05 +08:00
|
|
|
! HELP-FC1-NEXT: -fdebug-measure-parse-tree
|
|
|
|
! HELP-FC1-NEXT: Measure the parse tree
|
|
|
|
! HELP-FC1-NEXT: -fdebug-pre-fir-tree Dump the pre-FIR tree
|
2021-02-04 19:14:57 +08:00
|
|
|
! HELP-FC1-NEXT: -fdebug-unparse-with-symbols
|
|
|
|
! HELP-FC1-NEXT: Unparse and stop.
|
|
|
|
! HELP-FC1-NEXT: -fdebug-unparse Unparse and stop.
|
2021-03-04 00:28:11 +08:00
|
|
|
! HELP-FC1-NEXT: -fdefault-double-8 Set the default double precision kind to an 8 byte wide type
|
|
|
|
! HELP-FC1-NEXT: -fdefault-integer-8 Set the default integer kind to an 8 byte wide type
|
|
|
|
! HELP-FC1-NEXT: -fdefault-real-8 Set the default real kind to an 8 byte wide type
|
2021-01-27 00:27:30 +08:00
|
|
|
! HELP-FC1-NEXT: -ffixed-form Process source files in fixed form
|
|
|
|
! HELP-FC1-NEXT: -ffixed-line-length=<value>
|
|
|
|
! HELP-FC1-NEXT: Use <value> as character line width in fixed mode
|
|
|
|
! HELP-FC1-NEXT: -ffree-form Process source files in free form
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-FC1-NEXT: -fimplicit-none No implicit typing allowed unless overridden by IMPLICIT statements
|
|
|
|
! HELP-FC1-NEXT: -finput-charset=<value> Specify the default character set for source files
|
2021-03-04 00:28:11 +08:00
|
|
|
! HELP-FC1-NEXT: -flarge-sizes Use INTEGER(KIND=8) for the result type in size-related intrinsics
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-FC1-NEXT: -flogical-abbreviations Enable logical abbreviations
|
2021-02-10 17:24:45 +08:00
|
|
|
! HELP-FC1-NEXT: -fopenacc Enable OpenACC
|
|
|
|
! HELP-FC1-NEXT: -fopenmp Parse OpenMP pragmas and generate parallel code.
|
2021-02-05 05:11:22 +08:00
|
|
|
! HELP-FC1-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV.
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-FC1-NEXT: -help Display available options
|
2021-01-19 18:01:38 +08:00
|
|
|
! HELP-FC1-NEXT: -I <dir> Add directory to the end of the list of include search paths
|
2021-02-05 00:13:04 +08:00
|
|
|
! HELP-FC1-NEXT: -module-dir <dir> Put MODULE files in <dir>
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-FC1-NEXT: -o <file> Write output to <file>
|
2021-02-17 22:13:29 +08:00
|
|
|
! HELP-FC1-NEXT: -test-io Run the InputOuputTest action. Use for development and testing only.
|
2021-01-06 23:42:24 +08:00
|
|
|
! HELP-FC1-NEXT: -U <macro> Undefine macro <macro>
|
|
|
|
! HELP-FC1-NEXT: --version Print version information
|
2020-10-06 00:42:00 +08:00
|
|
|
|
2020-10-24 19:33:19 +08:00
|
|
|
!---------------
|
|
|
|
! EXPECTED ERROR
|
|
|
|
!---------------
|
|
|
|
! ERROR: error: unknown argument '-helps'; did you mean '-help'
|