! REQUIRES: new-flang-driver
-! CHECK:flang-new version
-! CHECK-NEXT:Target:
-! CHECK-NEXT:Thread model:
-! CHECK-NEXT:InstalledDir:
+! CHECK: flang-new version
+! CHECK-NEXT: Target:
+! CHECK-NEXT: Thread model:
+! CHECK-NEXT: InstalledDir:
! ERROR: flang-new: error: unsupported option '--versions'; did you mean '--version'?
! REQUIRES: new-flang-driver
!--------------------------
-! FLANG DRIVER (flang-new)
+! FLANG DRIVER (flang)
!--------------------------
! Input type is implicit
-! RUN: cat %s | flang-new -E - | FileCheck %s --check-prefix=PP-NOT-DEFINED
-! RUN: cat %s | flang-new -DNEW -E - | FileCheck %s --check-prefix=PP-DEFINED
+! RUN: cat %s | %flang -E - | FileCheck %s --check-prefix=PP-NOT-DEFINED
+! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-DEFINED
! Input type is explicit
-! RUN: cat %s | flang-new -E -x f95-cpp-input - | FileCheck %s --check-prefix=PP-NOT-DEFINED
-! RUN: cat %s | flang-new -DNEW -E -x f95-cpp-input - | FileCheck %s --check-prefix=PP-DEFINED
+! RUN: cat %s | %flang -E -x f95-cpp-input - | FileCheck %s --check-prefix=PP-NOT-DEFINED
+! RUN: cat %s | %flang -DNEW -E -x f95-cpp-input - | FileCheck %s --check-prefix=PP-DEFINED
!---------------------------------------
-! FLANG FRONTEND DRIVER (flang-new -fc1)
+! FLANG FRONTEND DRIVER (flang -fc1)
!---------------------------------------
! Test `-E`: for the corresponding frontend actions the driver relies on the prescanner API to handle file I/O
-! RUN: cat %s | flang-new -fc1 -E | FileCheck %s --check-prefix=PP-NOT-DEFINED
-! RUN: cat %s | flang-new -fc1 -DNEW -E | FileCheck %s --check-prefix=PP-DEFINED
+! RUN: cat %s | %flang -fc1 -E | FileCheck %s --check-prefix=PP-NOT-DEFINED
+! RUN: cat %s | %flang -fc1 -DNEW -E | FileCheck %s --check-prefix=PP-DEFINED
! Test `-test-io`: for the corresponding frontend action (`InputOutputTestAction`) the driver handles the file I/O on its own
! the corresponding action (`PrintPreprocessedAction`)
-! RUN: cat %s | flang-new -fc1 -test-io | FileCheck %s --check-prefix=IO --match-full-lines
-! RUN: cat %s | flang-new -fc1 -DNEW -test-io | FileCheck %s --check-prefix=IO --match-full-lines
+! RUN: cat %s | %flang -fc1 -test-io | FileCheck %s --check-prefix=IO --match-full-lines
+! RUN: cat %s | %flang -fc1 -DNEW -test-io | FileCheck %s --check-prefix=IO --match-full-lines
!-------------------------
! EXPECTED OUTPUT for `-E`
+++ /dev/null
-! RUN: %f18 < %S/Inputs/hello.f90 | FileCheck %s
-
-
-! CHECK: Enter Fortran source
-! CHECK: Use EOF character (^D) to end file
-
-! CHECK: Parse tree comprises {{.*}} objects and occupies {{.*}} total bytes
-! CHECK: PROGRAM hello
-! CHECK: WRITE (*, *) "hello world"
-! CHECK: END PROGRAM hello
+++ /dev/null
-! Check that lit configuration works by checking the compiler version
-
-! VERSION-NOT:{{![[:space:]]}}
-! VERSION:{{[[:space:]]}}
-! VERSION-SAME:f18 compiler (under development), version {{[1-9][0-9]*.[0-9]*.[0-9]*}}
-! VERSION-EMPTY:
-
-! RUN: %f18 -V 2>&1 | FileCheck -check-prefix=VERSION %s
-! RUN: %f18 -v 2>&1 | FileCheck -check-prefix=VERSION %s
-! RUN: %f18 --version 2>&1 | FileCheck -check-prefix=VERSION %s
-! RUN: rm -rf %t && mkdir -p %t/mod-dir && cd %t && %f18 -fparse-only %s
-! RUN: ls %t/testmodule.mod && not ls %t/mod-dir/testmodule.mod
+! Checks that the module file:
+! * is _saved_
+! * is saved in the _directory specified by the user_
+! We use `-fsyntax-only` as it stops after the semantic checks (the module file is generated when sema checks are run)
-! RUN: rm -rf %t && mkdir -p %t/mod-dir && cd %t && %f18 -fparse-only -module mod-dir %s
-! RUN: ls %t/mod-dir/testmodule.mod && not ls %t/testmodule.mod
+!--------------------------
+! -module-dir
+!--------------------------
+! RUN: rm -rf %t && mkdir -p %t/dir-flang
+! RUN: cd %t && %flang -fsyntax-only -module-dir %t/dir-flang %s
+! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
-! RUN: rm -rf %t && mkdir -p %t/mod-dir && cd %t && %f18 -fparse-only -module-dir mod-dir %s
-! RUN: ls %t/mod-dir/testmodule.mod && not ls %t/testmodule.mod
+!---------------------------
+! -J <dir> (i.e. with space)
+!---------------------------
+! RUN: rm -rf %t && mkdir -p %t/dir-flang
+! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
+! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
-! RUN: rm -rf %t && mkdir -p %t/mod-dir && cd %t && %f18 -fparse-only -J mod-dir %s
-! RUN: ls %t/mod-dir/testmodule.mod && not ls %t/testmodule.mod
-
-! RUN: rm -rf %t && mkdir -p %t/mod-dir && cd %t && %f18 -fparse-only -Jmod-dir %s
-! RUN: ls %t/mod-dir/testmodule.mod && not ls %t/testmodule.mod
+!------------------------------
+! -J<dir> (i.e. without space)
+!------------------------------
+! RUN: rm -rf %t && mkdir -p %t/dir-flang
+! RUN: cd %t && %flang -fsyntax-only -J%t/dir-flang %s
+! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
module testmodule
type::t2
+++ /dev/null
-! RUN: rm -rf %t && mkdir -p %t/dir-flang
-! RUN: cd %t && %flang -fsyntax-only -module-dir %t/dir-flang %s
-! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
-
-! RUN: rm -rf %t && mkdir -p %t/dir-flang
-! RUN: cd %t && %flang -fsyntax-only -J %t/dir-flang %s
-! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
-
-! RUN: rm -rf %t && mkdir -p %t/dir-flang
-! RUN: cd %t && %flang -fsyntax-only -J%t/dir-flang %s
-! RUN: ls %t/dir-flang/testmodule.mod && not ls %t/testmodule.mod
-
-module testmodule
- type::t2
- end type
-end