1! REQUIRES: new-flang-driver
2
3! Test the behaviour of the driver when input is missing or is invalid. Note
4! that with the compiler driver (flang-new), the input _has_ to be specified.
5! Indeed, the driver decides what "job/command" to create based on the input
6! file's extension. No input file means that it doesn't know what to do
7! (compile?  preprocess? link?). The frontend driver (flang-new -fc1) simply
8! assumes that "no explicit input == read from stdin"
9
10!--------------------------
11! FLANG DRIVER (flang-new)
12!--------------------------
13! RUN: not %flang-new  2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE
14! RUN: not %flang-new %t 2>&1 | FileCheck %s --check-prefix=FLANG-NONEXISTENT-FILE
15
16!-----------------------------------------
17! FLANG FRONTEND DRIVER (flang-new -fc1)
18!-----------------------------------------
19! RUN: not %flang-new -fc1 %t 2>&1  | FileCheck %s --check-prefix=FLANG-FC1-NONEXISTENT-FILE
20! RUN: not %flang-new -fc1 %S 2>&1  | FileCheck %s --check-prefix=FLANG-FC1-DIR
21
22!-----------------------
23! EXPECTED OUTPUT
24!-----------------------
25! FLANG-NO-FILE: flang-new: error: no input files
26
27! FLANG-NONEXISTENT-FILE: flang-new: error: no such file or directory: {{.*}}
28! FLANG-NONEXISTENT-FILE: flang-new: error: no input files
29
30! FLANG-FC1-NONEXISTENT-FILE: error: {{.*}} does not exist
31! FLANG-FC1-DIR: error: {{.*}} is not a regular file
32