1! Verify that the driver correctly processes `-fsyntax-only`. 2! 3! By default, the compiler driver (`flang`) will create actions/phases to 4! generate machine code (i.e. object files). The `-fsyntax-only` flag is a 5! "phase-control" flag that controls this behavior and makes the driver stop 6! once the semantic checks have been run. The frontend driver (`flang -fc1`) 7! runs `-fsyntax-only` by default (i.e. that's the default action), so the flag 8! can be skipped. 9 10!----------- 11! RUN LINES 12!----------- 13! RUN: %flang -fsyntax-only %s 2>&1 | FileCheck %s --allow-empty 14! RUN: %flang_fc1 %s 2>&1 | FileCheck %s --allow-empty 15 16! RUN: rm -rf %t/non-existent-dir/ 17! RUN: not %flang -c %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY 18! RUN: not %flang_fc1 -emit-obj %s -o %t/non-existent-dir/syntax-only.o 2>&1 | FileCheck %s --check-prefix=NO_FSYNTAX_ONLY 19 20!----------------- 21! EXPECTED OUTPUT 22!----------------- 23! CHECK-NOT: error 24! NO_FSYNTAX_ONLY: error: failed to create the output file 25 26!------- 27! INPUT 28!------- 29end program 30