1 ! Verify that reading from stdin works as expected - Fortran input
3 !--------------------------
5 !--------------------------
6 ! Input type is implicit
7 ! RUN: cat %s | %flang -E -cpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
8 ! RUN: cat %s | %flang -DNEW -E -cpp - | FileCheck %s --check-prefix=PP-DEFINED
9 ! RUN: cat %s | %flang -DNEW -E - | FileCheck %s --check-prefix=PP-NOT-DEFINED
10 ! RUN: cat %s | %flang -DNEW -E -nocpp - | FileCheck %s --check-prefix=PP-NOT-DEFINED
12 ! Input type is explicit
13 ! RUN: cat %s | %flang -E -cpp -x f95-cpp-input - | FileCheck %s --check-prefix=PP-NOT-DEFINED
14 ! RUN: cat %s | %flang -DNEW -E -cpp -x f95-cpp-input - | FileCheck %s --check-prefix=PP-DEFINED
16 !---------------------------------------
17 ! FLANG FRONTEND DRIVER (flang -fc1)
18 !---------------------------------------
19 ! Test `-E`: for the corresponding frontend actions the driver relies on the prescanner API to handle file I/O
20 ! RUN: cat %s | %flang_fc1 -E -cpp | FileCheck %s --check-prefix=PP-NOT-DEFINED
21 ! RUN: cat %s | %flang_fc1 -DNEW -E -cpp | FileCheck %s --check-prefix=PP-DEFINED
23 ! Test `-test-io`: for the corresponding frontend action (`InputOutputTestAction`) the driver handles the file I/O on its own
24 ! the corresponding action (`PrintPreprocessedAction`)
25 ! RUN: cat %s | %flang_fc1 -test-io -cpp | FileCheck %s --check-prefix=IO --match-full-lines
26 ! RUN: cat %s | %flang_fc1 -DNEW -cpp -test-io | FileCheck %s --check-prefix=IO --match-full-lines
28 ! PP-NOT-DEFINED: Program B
29 ! PP-DEFINED: Program A