-! RUN: not %flang-new %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new -c %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %flang-new -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-! REQUIRES: new-flang-driver
-
! Although code-generation is not yet available, we do have frontend actions
! that correspond to `-c` and `-emit-obj`. For now these actions are just a
! placeholder and running them leads to a driver error. This test makes sure
! rejected earlier).
! TODO: Replace this file with a proper test once code-generation is available.
+! REQUIRES: new-flang-driver
+
+!-----------
+! RUN LINES
+!-----------
+! RUN: not %flang %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang -c %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: not %flang -fc1 -emit-obj %s 2>&1 | FileCheck %s --check-prefix=ERROR
+
+!-----------------------
+! EXPECTED OUTPUT
+!-----------------------
! ERROR: code-generation is not available yet
! Ensure argument -fdebug-measure-parse-tree works as expected.
-! REQUIRES: new-flang-driver
-
-!--------------------------
-! FLANG DRIVER (flang-new)
-!--------------------------
-! RUN: not %flang-new -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=FLANG
-
-!----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
-!----------------------------------------
-! RUN: %flang-new -fc1 -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=FRONTEND
-
-!----------------------------------
-! EXPECTED OUTPUT WITH `flang-new`
-!----------------------------------
-! FLANG:warning: argument unused during compilation: '-fdebug-measure-parse-tree'
-
-!---------------------------------------
-! EXPECTED OUTPUT WITH `flang-new -fc1`
-!---------------------------------------
+!----------
+! RUN LINE
+!----------
+! RUN: %flang_fc1 -fsyntax-only -fdebug-measure-parse-tree %s 2>&1 | FileCheck %s --check-prefix=FRONTEND
+
+!-----------------
+! EXPECTED OUTPUT
+!-----------------
! FRONTEND:Parse tree comprises {{[0-9]+}} objects and occupies {{[0-9]+}} total bytes.
program A
-// RUN: not %flang-new %s 2>&1 | FileCheck %s
+// C files are currently not supported (i.e. `flang -cc1`). Make sure that the
+// driver reports this as expected.
// REQUIRES: new-flang-driver
-// C files are currently not supported (i.e. `flang -cc1`)
+//-----------
+// RUN LINES
+//-----------
+// RUN: not %flang %s 2>&1 | FileCheck %s
+//-----------------------
+// EXPECTED OUTPUT
+//-----------------------
// CHECK: error: unknown integrated tool '-cc1'. Valid tools include '-fc1'.
-// RUN: not %flang-new %s 2>&1 | FileCheck %s
+// C++ files are currently not supported (i.e. `flang -cc1`). Make sure that the
+// driver reports this as expected.
// REQUIRES: new-flang-driver
-// C++ files are currently not supported (i.e. `flang -cc1`)
+//-----------
+// RUN LINES
+//-----------
+// RUN: not %flang %s 2>&1 | FileCheck %s
+//-----------------------
+// EXPECTED OUTPUT
+//-----------------------
// CHECK: error: unknown integrated tool '-cc1'. Valid tools include '-fc1'.
!--------------------------
! FLANG DRIVER (flang-new)
!--------------------------
-! RUN: %flang-new --help-hidden 2>&1 | FileCheck %s
-! RUN: not %flang-new -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG
+! RUN: %flang --help-hidden 2>&1 | FileCheck %s
+! RUN: not %flang -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG
!----------------------------------------
! FLANG FRONTEND DRIVER (flang-new -fc1)
!----------------------------------------
-! RUN: not %flang-new -fc1 --help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
-! RUN: not %flang-new -fc1 -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
+! RUN: not %flang_fc1 --help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
+! RUN: not %flang_fc1 -help-hidden 2>&1 | FileCheck %s --check-prefix=ERROR-FLANG-FC1
!----------------------------------------------------
! EXPECTED OUTPUT FOR FLANG DRIVER (flang-new)
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: %flang-new -help 2>&1 | FileCheck %s --check-prefix=HELP
-! RUN: not %flang-new -helps 2>&1 | FileCheck %s --check-prefix=ERROR
+! RUN: %flang -help 2>&1 | FileCheck %s --check-prefix=HELP
+! RUN: not %flang -helps 2>&1 | FileCheck %s --check-prefix=ERROR
!----------------------------------------
-! FLANG FRONTEND DRIVER (flang-new -fc1)
+! FLANG FRONTEND DRIVER (flang -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
+! RUN: %flang_fc1 -help 2>&1 | FileCheck %s --check-prefix=HELP-FC1
+! RUN: not %flang_fc1 -helps 2>&1 | FileCheck %s --check-prefix=ERROR
!----------------------------------------------------
-! EXPECTED OUTPUT FOR FLANG DRIVER (flang-new)
+! EXPECTED OUTPUT FOR FLANG DRIVER (flang)
!----------------------------------------------------
-! HELP:USAGE: flang-new
+! HELP:USAGE: flang
! HELP-EMPTY:
! HELP-NEXT:OPTIONS:
! HELP-NEXT: -### Print (but do not run) the commands to run for this compilation
! HELP-NEXT: -Xflang <arg> Pass <arg> to the flang compiler
!-------------------------------------------------------------
-! EXPECTED OUTPUT FOR FLANG FRONTEND DRIVER (flang-new -fc1)
+! EXPECTED OUTPUT FOR FLANG FRONTEND DRIVER (flang -fc1)
!-------------------------------------------------------------
-! HELP-FC1:USAGE: flang-new
+! HELP-FC1:USAGE: flang
! HELP-FC1-EMPTY:
! HELP-FC1-NEXT:OPTIONS:
! HELP-FC1-NEXT: -cpp Enable predefined and command line preprocessor macros
-! RUN: %flang-new --version 2>&1 | FileCheck %s
-! RUN: not %flang-new --versions 2>&1 | FileCheck %s --check-prefix=ERROR
-
! REQUIRES: new-flang-driver
+!-----------
+! RUN LINES
+!-----------
+! RUN: %flang --version 2>&1 | FileCheck %s
+! RUN: not %flang --versions 2>&1 | FileCheck %s --check-prefix=ERROR
+
+!-----------------------
+! EXPECTED OUTPUT
+!-----------------------
! CHECK: flang-new version
! CHECK-NEXT: Target:
! CHECK-NEXT: Thread model:
! Ensure argument -fbackslash works as expected.
-! REQUIRES: new-flang-driver
-
!--------------------------
! FLANG DRIVER (flang-new)
!--------------------------
-! RUN: %flang-new -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
-! RUN: %flang-new -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
-! RUN: %flang-new -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED
+! RUN: %flang -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
+! RUN: %flang -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
+! RUN: %flang -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED
!-----------------------------------------
! FRONTEND FLANG DRIVER (flang-new -fc1)
!-----------------------------------------
-! RUN: %flang-new -fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
-! RUN: %flang-new -fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
-! RUN: %flang-new -fc1 -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED
+! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
+! RUN: %flang_fc1 -E -fbackslash -fno-backslash %s 2>&1 | FileCheck %s --check-prefix=ESCAPED
+! RUN: %flang_fc1 -E -fbackslash %s 2>&1 | FileCheck %s --check-prefix=UNESCAPED
!-----------------------------------------
! EXPECTED OUTPUT FOR ESCAPED BACKSLASHES
! This test exploits the fact that the preprocessor treats white-spaces differently for free
! and fixed form input files.
-! REQUIRES: new-flang-driver
-
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: %flang-new -E %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM
-! RUN: %flang-new -E %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
-! RUN: %flang-new -E %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS
+! RUN: %flang -E %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM
+! RUN: %flang -E %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
+! RUN: %flang -E %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS
!-----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang_fc1)
!-----------------------------------------
-! RUN: %flang-new -fc1 -E %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM
-! RUN: %flang-new -fc1 -E %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
-! RUN: %flang-new -fc1 -E %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS
+! RUN: %flang_fc1 -E %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FREEFORM
+! RUN: %flang_fc1 -E %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
+! RUN: %flang_fc1 -E %S/Inputs/free-form-test.f90 %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=MULTIPLEFORMS
!-------------------------------------
! EXPECTED OUTPUT FOR A FREE FORM FILE
! Ensure arguments -ffree-form and -ffixed-form work as expected.
-! REQUIRES: new-flang-driver
-
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: not %flang-new -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM
-! RUN: %flang-new -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
+! RUN: not %flang -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM
+! RUN: %flang -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
!----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang -fc1)
!----------------------------------------
-! RUN: not %flang-new -fc1 -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM
-! RUN: %flang-new -fc1 -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
+! RUN: not %flang_fc1 -fsyntax-only -ffree-form %S/Inputs/fixed-form-test.f 2>&1 | FileCheck %s --check-prefix=FREEFORM
+! RUN: %flang_fc1 -fsyntax-only -ffixed-form %S/Inputs/free-form-test.f90 2>&1 | FileCheck %s --check-prefix=FIXEDFORM
!------------------------------------
! EXPECTED OUTPUT FOR FREE FORM MODE
!------------------------------------
-! FREEFORM:error: Could not parse
+! FREEFORM: Could not parse
!-------------------------------------
! EXPECTED OUTPUT FOR FIXED FORM MODE
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: %flang-new -E %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
-! RUN: not %flang-new -E -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
-! RUN: not %flang-new -E -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
-! RUN: %flang-new -E -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
-! RUN: %flang-new -E -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
-! RUN: %flang-new -E -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
+! RUN: %flang -E %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
+! RUN: not %flang -E -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
+! RUN: not %flang -E -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
+! RUN: %flang -E -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
+! RUN: %flang -E -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
+! RUN: %flang -E -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
!----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang -fc1)
!----------------------------------------
-! RUN: %flang-new -fc1 -E %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
-! RUN: not %flang-new -fc1 -E -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
-! RUN: not %flang-new -fc1 -E -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
-! RUN: %flang-new -fc1 -E -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
-! RUN: %flang-new -fc1 -E -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
-! RUN: %flang-new -fc1 -E -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
+! RUN: %flang_fc1 -E %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=DEFAULTLENGTH
+! RUN: not %flang_fc1 -E -ffixed-line-length=-2 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=NEGATIVELENGTH
+! RUN: not %flang_fc1 -E -ffixed-line-length=3 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=INVALIDLENGTH
+! RUN: %flang_fc1 -E -ffixed-line-length=none %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
+! RUN: %flang_fc1 -E -ffixed-line-length=0 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=UNLIMITEDLENGTH
+! RUN: %flang_fc1 -E -ffixed-line-length=13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
!-------------------------------------
! COMMAND ALIAS -ffixed-line-length-n
!-------------------------------------
-! RUN: %flang-new -E -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
-! RUN: %flang-new -fc1 -E -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
+! RUN: %flang -E -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
+! RUN: %flang_fc1 -E -ffixed-line-length-13 %S/Inputs/fixed-line-length-test.f 2>&1 | FileCheck %s --check-prefix=LENGTH13
!-------------------------------------
! EXPECTED OUTPUT WITH DEFAULT LENGTH
! REQUIRES: new-flang-driver
-! RUN: %flang-new -fsyntax-only -### %s -o %t 2>&1 \
+! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
! RUN: -finput-charset=utf-8 \
! RUN: -fdefault-double-8 \
! RUN: -fdefault-integer-8 \
! Ensure argument -fimplicit-none works as expected.
-! REQUIRES: new-flang-driver
-
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: %flang-new -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
-! RUN: %flang-new -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
-! RUN: not %flang-new -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE
+! RUN: %flang -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
+! RUN: %flang -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
+! RUN: not %flang -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE
!-----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang_fc1)
!-----------------------------------------
-! RUN: %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
-! RUN: %flang-new -fc1 -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
-! RUN: not %flang-new -fc1 -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE
+! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
+! RUN: %flang_fc1 -fsyntax-only -fimplicit-none -fno-implicit-none %s 2>&1 | FileCheck %s --allow-empty --check-prefix=DEFAULT
+! RUN: not %flang_fc1 -fsyntax-only -fimplicit-none %s 2>&1 | FileCheck %s --check-prefix=WITH_IMPL_NONE
!--------------------------------------
! EXPECTED OUTPUT FOR NO IMPLICIT NONE
! Ensure argument -I works as expected with an included header.
-! REQUIRES: new-flang-driver
-
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: not %flang-new -E %s 2>&1 | FileCheck %s --check-prefix=UNINCLUDED
-! RUN: %flang-new -E -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
-! RUN: %flang-new -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY
-! RUN: %flang-new -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY
+! RUN: not %flang -E %s 2>&1 | FileCheck %s --check-prefix=UNINCLUDED
+! RUN: %flang -E -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
+! RUN: %flang -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY
+! RUN: %flang -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY
!----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang_fc1)
!----------------------------------------
-! RUN: not %flang-new -fc1 -E %s 2>&1 | FileCheck %s --check-prefix=UNINCLUDED
-! RUN: %flang-new -fc1 -E -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
-! RUN: %flang-new -fc1 -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY
-! RUN: %flang-new -fc1 -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY
+! RUN: not %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=UNINCLUDED
+! RUN: %flang_fc1 -E -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SINGLEINCLUDE
+! RUN: %flang_fc1 -E -I %S/Inputs -I %S/Inputs/header-dir %s 2>&1 | FileCheck %s --check-prefix=MAINDIRECTORY
+! RUN: %flang_fc1 -E -I %S/Inputs/header-dir -I %S/Inputs %s 2>&1 | FileCheck %s --check-prefix=SUBDIRECTORY
!--------------------------------------------
! EXPECTED OUTPUT FOR MISSING INCLUDED FILE
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
-! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang-new -E %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s
+! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang -E %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s
!-----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
+! FRONTEND FLANG DRIVER (flang_fc1)
!-----------------------------------------
-! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang-new -fc1 -E %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s
+! RUN: printf -- "-DX=A\\\\\nTHIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT\n" | xargs %flang_fc1 -E %s 2>&1 | FileCheck --strict-whitespace --match-full-lines %s
!-------------------------------
! EXPECTED OUTPUT FOR MACRO 'X'
! CHECK-NOT:THIS_SHOULD_NOT_EXIST_IN_THE_OUTPUT
! CHECK-NOT:this_should_not_exist_in_the_output
-START X END
\ No newline at end of file
+START X END
-! REQUIRES: new-flang-driver
-
! Test the behaviour of the driver when input is missing or is invalid. Note
! that with the compiler driver (flang-new), the input _has_ to be specified.
! Indeed, the driver decides what "job/command" to create based on the input
! (compile? preprocess? link?). The frontend driver (flang-new -fc1) simply
! assumes that "no explicit input == read from stdin"
+! REQUIRES: new-flang-driver
+
!--------------------------
! FLANG DRIVER (flang-new)
!--------------------------
-! RUN: not %flang-new 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE
-! RUN: not %flang-new %t 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE
+! RUN: not %flang 2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE
+! RUN: not %flang %t 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE
!-----------------------------------------
! FLANG FRONTEND DRIVER (flang-new -fc1)
!-----------------------------------------
-! RUN: not %flang-new -fc1 %t 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE
-! RUN: not %flang-new -fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR
+! RUN: not %flang_fc1 %t 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE
+! RUN: not %flang_fc1 %S 2>&1 | FileCheck %s --check-prefix=FLANG-FC1-DIR
!-----------------------
! EXPECTED OUTPUT
-! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %f18 -syntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
+! Verify that parsing errors are correctly reported by the driver
-! REQUIRES: new-flang-driver
+! RUN: not %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=ERROR
! ERROR: Could not parse {{.*}}parse-error.f95
-! RUN: %flang-new -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
-! RUN: %flang-new -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
-! RUN: %flang-new -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
+! This test verifies the phase control in Flang compiler driver.
! REQUIRES: new-flang-driver
-! This test verifies the phase control in Flang compiler driver.
+!-----------
+! RUN LINES
+!-----------
+! RUN: %flang -E -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=PP
+! RUN: %flang -fsyntax-only -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=COMPILE
+! RUN: %flang -c -ccc-print-phases %s 2>&1 | FileCheck %s --check-prefix=EMIT_OBJ
+!-----------------------
+! EXPECTED OUTPUT
+!-----------------------
! PP: +- 0: input, "{{.*}}phases.f90", f95-cpp-input
! PP-NEXT: 1: preprocessor, {0}, f95
-! RUN: not %flang-new -fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ERROR
-! RUN: not %f18 -E %s 2>&1 | FileCheck %s --check-prefix=ERROR
-
-! REQUIRES: new-flang-driver
+! RUN: not %flang_fc1 -E %s 2>&1 | FileCheck %s --check-prefix=ERROR
! ERROR: Could not scan {{.*}}scanning-error.f95
-! RUN: not %flang-new -fc1 -fsyntax-only %s 2>&1 | FileCheck %s
-! RUN: not %f18 -fsyntax-only %s 2>&1 | FileCheck %s
+! Verify that the compiler driver correctly processes `-fsyntax-only`. By
+! default it will try to run code-generation, but that's not supported yet. We
+! don't need to test the frontend driver here - it runs `-fsyntax-only` by
+! default.
! REQUIRES: new-flang-driver
-! CHECK: IF statement is not allowed in IF statement
-! CHECK: Semantic errors in {{.*}}syntax-only.f90
+!-----------
+! RUN LINES
+!-----------
+! RUN: not %flang -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix=FSYNTAX_ONLY
+! RUN: not %flang %s 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY
+
+!-----------------
+! EXPECTED OUTPUT
+!-----------------
+! FSYNTAX_ONLY: IF statement is not allowed in IF statement
+! FSYNTAX_ONLY_NEXT: Semantic errors in {{.*}}syntax-only.f90
+
+! NO_FSYNTAX_ONLY: error: code-generation is not available yet
+
+!-------
+! INPUT
+!-------
IF (A > 0.0) IF (B < 0.0) A = LOG (A)
END
+++ /dev/null
-int main() { return 0; }
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
! NOTE: Use `-E` so that the compiler driver stops after the 1st compilation phase, preprocessing. That's all we need.
! TEST 1: Print to stdout (implicit)
-! RUN: %flang-new -E -Xflang -test-io %s 2>&1 | FileCheck %s --match-full-lines
+! RUN: %flang -E -Xflang -test-io %s 2>&1 | FileCheck %s --match-full-lines
! TEST 2: Print to stdout (explicit)
-! RUN: %flang-new -E -Xflang -test-io -o - %s 2>&1 | FileCheck %s --match-full-lines
+! RUN: %flang -E -Xflang -test-io -o - %s 2>&1 | FileCheck %s --match-full-lines
! TEST 3: Print to a file
-! RUN: %flang-new -E -Xflang -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
+! RUN: %flang -E -Xflang -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
!----------------------------------------
-! FLANG FRONTEND DRIVER (flang-new -fc1)
+! FLANG FRONTEND DRIVER (flang -fc1)
!----------------------------------------
! TEST 4: Write to a file (implicit)
! This particular test case generates an output file in the same directory as the input file. We need to copy the input file into a
! temporary directory to avoid polluting the source directory.
! RUN: rm -rf %t-dir && mkdir -p %t-dir && cd %t-dir
! RUN: cp %s .
-! RUN: %flang-new -fc1 -test-io input-output-file.f90 2>&1 && FileCheck %s --match-full-lines --input-file=input-output-file.txt
+! RUN: %flang_fc1 -test-io input-output-file.f90 2>&1 && FileCheck %s --match-full-lines --input-file=input-output-file.txt
! TEST 5: Write to a file (explicit)
-! RUN: %flang-new -fc1 -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
+! RUN: %flang_fc1 -test-io -o %t %s 2>&1 && FileCheck %s --match-full-lines --input-file=%t
!-----------------------
! EXPECTED OUTPUT
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
! NOTE: Use `-E` so that the compiler driver stops after the 1st compilation phase, preprocessing. That's all we need.
! TEST 1: Both input files are processed (output is printed to stdout)
-! RUN: %flang-new -E -Xflang -test-io %s %S/Inputs/hello-world.f90 | FileCheck %s --match-full-lines -check-prefix=FLANG
+! RUN: %flang -E -Xflang -test-io %s %S/Inputs/hello-world.f90 | FileCheck %s --match-full-lines -check-prefix=FLANG
! TEST 2: None of the files is processed (not possible to specify the output file when multiple input files are present)
-! RUN: not %flang-new -E -Xflang -test-io -o - %S/Inputs/hello-world.f90 %s 2>&1 | FileCheck %s --match-full-lines -check-prefix=ERROR
-! RUN: not %flang-new -E -Xflang -test-io -o %t %S/Inputs/hello-world.f90 %s 2>&1 | FileCheck %s --match-full-lines -check-prefix=ERROR
+! RUN: not %flang -E -Xflang -test-io -o - %S/Inputs/hello-world.f90 %s 2>&1 | FileCheck %s --match-full-lines -check-prefix=ERROR
+! RUN: not %flang -E -Xflang -test-io -o %t %S/Inputs/hello-world.f90 %s 2>&1 | FileCheck %s --match-full-lines -check-prefix=ERROR
!----------------------------------------
-! FLANG FRONTEND DRIVER (flang-new -fc1)
+! FLANG FRONTEND DRIVER (flang -fc1)
!----------------------------------------
! TEST 3: Both input files are processed
! This particular test case generates output files in the same directory as the input files. We need to copy the input files into a
! temporary directory to avoid polluting the source directory.
! RUN: rm -rf %t-dir && mkdir -p %t-dir && cd %t-dir
! RUN: cp %s . && cp %S/Inputs/hello-world.f90 .
-! RUN: %flang-new -fc1 -test-io hello-world.f90 multiple-input-files.f90 2>&1 \
+! RUN: %flang_fc1 -test-io hello-world.f90 multiple-input-files.f90 2>&1 \
! RUN: && FileCheck %s --input-file=multiple-input-files.txt --match-full-lines -check-prefix=FC1-OUTPUT1 \
! RUN: && FileCheck %s --input-file=hello-world.txt --match-full-lines -check-prefix=FC1-OUTPUT2
! TEST 4: Only the last input file is processed
-! RUN: %flang-new -fc1 -test-io %s %S/Inputs/hello-world.f90 -o %t 2>&1 \
+! RUN: %flang_fc1 -test-io %s %S/Inputs/hello-world.f90 -o %t 2>&1 \
! RUN: && FileCheck %s --input-file=%t --match-full-lines -check-prefix=FC1-OUTPUT3
!-----------------------
! EXPECTED OUTPUT
!-----------------------
-! TEST 1: By default, `flang-new` prints the output from all input files to
+! TEST 1: By default, `flang` prints the output from all input files to
! stdout
! FLANG-LABEL: Program arithmetic
! FLANG-NEXT: Integer :: i, j
! FLANG-NEXT: write(*,*) 'Hello world!'
! FLANG-NEXT:end program hello
-! TEST 2: `-o` does not work for `flang-new` when multiple input files are present
+! TEST 2: `-o` does not work for `flang` when multiple input files are present
! ERROR: flang-new: error: cannot specify -o when generating multiple output files
-! TEST 3: The output file _was not_ specified - `flang-new -fc1` will process all
+! TEST 3: The output file _was not_ specified - `flang_fc1` will process all
! input files and generate one output file for every input file.
! FC1-OUTPUT1-LABEL: Program arithmetic
! FC1-OUTPUT1-NEXT: Integer :: i, j
! FC1-OUTPUT2-NEXT: write(*,*) 'Hello world!'
! FC1-OUTPUT2-NEXT:end program hello
-! TEST 4: The output file _was_ specified - `flang-new -fc1` will process only
+! TEST 4: The output file _was_ specified - `flang_fc1` will process only
! the last input file and generate the corresponding output.
! FC1-OUTPUT3-LABEL:!This is a test file with a hello world in Fortran
! FC1-OUTPUT3-NEXT:program hello
-! Test that the driver correctly reports diagnostics from the prescanner. The contents of the include file are irrelevant here.
+! Test that the driver correctly reports diagnostics from the prescanner, no
+! matter what driver action/phase is run. We need this test as Flang currently
+! has no central API for managing the diagnostics. For this reason the driver
+! needs to make sure that the diagnostics are indeed issued (rather that relying
+! on some DiagnosticsEngine).
+!-----------
+! RUN LINES
+!-----------
! Test with -E (i.e. PrintPreprocessedAction, stops after prescanning)
! RUN: %flang -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -E -I %S/Inputs/ %s 2>&1 | FileCheck %s
! RUN: %flang -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -fsyntax-only -I %S/Inputs/ %s 2>&1 | FileCheck %s
-! CHECK: prescanner-diag.f90:12:20: #include: extra stuff ignored after file name
+!-----------------------
+! EXPECTED OUTPUT
+!-----------------------
+! CHECK: prescanner-diag.f90:27:20: #include: extra stuff ignored after file name
+! CHECK: prescanner-diag.f90:28:20: #include: extra stuff ignored after file name
+
+!-------
+! INPUT
+!-------
#include <empty.h> comment
-! CHECK: prescanner-diag.f90:14:20: #include: extra stuff ignored after file name
#include "empty.h" comment
end
+++ /dev/null
-! Test preprocessing for C files using Flang driver
-
-! REQUIRES: new-flang-driver
-
-!--------------------------
-! FLANG DRIVER (flang-new)
-!--------------------------
-! RUN: not %flang-new -E %S/Inputs/hello-world.c 2>&1 | FileCheck %s
-
-!-----------------------
-! EXPECTED OUTPUT
-!-----------------------
-! CHECK: error: unknown integrated tool '-cc1'. Valid tools include '-fc1'.
+++ /dev/null
-! Test printpreprocessed action
-
-! REQUIRES: new-flang-driver
-
-!--------------------------
-! FLANG DRIVER (flang-new)
-!--------------------------
-! RUN: %flang-new -E %s 2>&1 | FileCheck %s
-
-!-----------------------------------------
-! FRONTEND FLANG DRIVER (flang-new -fc1)
-!-----------------------------------------
-! RUN: %flang-new -fc1 -E %s 2>&1 | FileCheck %s
-
-!-----------------------
-! EXPECTED OUTPUT
-!-----------------------
-! CHECK:program a
-! CHECK-NOT:program b
-! CHECK-NEXT:x = 1
-! CHECK-NEXT:write(*,*) x
-! CHECK-NEXT:end
-
-! Preprocessed-file.F:
-#define NEW
-#ifdef NEW
- program A
-#else
- program B
-#endif
- x = 1
- write(*,*) x
- end
]
if config.include_flang_new_driver_test:
- tools.append(ToolSubst('%flang-new', command=FindTool('flang-new'), unresolved='fatal'))
tools.append(ToolSubst('%flang', command=FindTool('flang-new'), unresolved='fatal'))
tools.append(ToolSubst('%flang_fc1', command=FindTool('flang-new'),
extra_args=['-fc1'], unresolved='fatal'))
options.features.Enable(
Fortran::parser::LanguageFeature::LogicalAbbreviations,
arg == "-flogical-abbreviations");
- } else if (arg == "-fimplicit-none-type-always") {
+ } else if (arg == "-fimplicit-none-type-always" ||
+ arg == "-fimplicit-none") {
options.features.Enable(
Fortran::common::LanguageFeature::ImplicitNoneTypeAlways);
+ } else if (arg == "-fno-implicit-none") {
+ options.features.Enable(
+ Fortran::common::LanguageFeature::ImplicitNoneTypeAlways, false);
} else if (arg == "-fimplicit-none-type-never") {
options.features.Enable(
Fortran::common::LanguageFeature::ImplicitNoneTypeNever);