diff --git a/flang/test/Driver/Inputs/hello.f90 b/flang/test/Driver/Inputs/hello.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Driver/Inputs/hello.f90 @@ -0,0 +1,3 @@ +program hello + write (*,*), "hello world" +end program hello diff --git a/flang/test/Driver/no_files.f90 b/flang/test/Driver/no_files.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Driver/no_files.f90 @@ -0,0 +1,10 @@ +! 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 diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp --- a/flang/tools/f18/f18.cpp +++ b/flang/tools/f18/f18.cpp @@ -686,6 +686,8 @@ if (!anyFiles) { driver.measureTree = true; driver.dumpUnparse = true; + llvm::outs() << "Enter Fortran source\n" + << "Use EOF character (^D) to end file\n"; CompileFortran("-", options, driver, defaultKinds); return exitStatus; }