xref: /llvm-project/flang/test/Driver/missing-input.f90 (revision 06eb10dadfaeaadc5d0d95d38bea4bfb5253e077)
145da495fSAndrzej Warzynski! Test the behaviour of the driver when input is missing or is invalid. Note
2*06eb10daSBrad Richardson! that with the compiler driver (flang), the input _has_ to be specified.
345da495fSAndrzej Warzynski! Indeed, the driver decides what "job/command" to create based on the input
445da495fSAndrzej Warzynski! file's extension. No input file means that it doesn't know what to do
5*06eb10daSBrad Richardson! (compile?  preprocess? link?). The frontend driver (flang -fc1) simply
645da495fSAndrzej Warzynski! assumes that "no explicit input == read from stdin"
745da495fSAndrzej Warzynski
845da495fSAndrzej Warzynski!--------------------------
9*06eb10daSBrad Richardson! FLANG DRIVER (flang)
1045da495fSAndrzej Warzynski!--------------------------
11808a5a25SAndrzej Warzynski! RUN: not %flang  2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE
12648feabcSNico Weber! RUN: not %flang %t.f90 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE
1345da495fSAndrzej Warzynski
1445da495fSAndrzej Warzynski!-----------------------------------------
15*06eb10daSBrad Richardson! FLANG FRONTEND DRIVER (flang -fc1)
1645da495fSAndrzej Warzynski!-----------------------------------------
17648feabcSNico Weber! RUN: not %flang_fc1 %t.f90 2>&1  | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE
18808a5a25SAndrzej Warzynski! RUN: not %flang_fc1 %S 2>&1  | FileCheck %s --check-prefix=FLANG-FC1-DIR
1945da495fSAndrzej Warzynski
20*06eb10daSBrad Richardson! FLANG-NO-FILE: flang{{.*}}: error: no input files
2145da495fSAndrzej Warzynski
22*06eb10daSBrad Richardson! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no such file or directory: {{.*}}
23*06eb10daSBrad Richardson! FLANG-NONEXISTENT-FILE: flang{{.*}}: error: no input files
2445da495fSAndrzej Warzynski
2545da495fSAndrzej Warzynski! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist
2645da495fSAndrzej Warzynski! FLANG-FC1-DIR: error: {{.*}} is not a regular file
27