Add support for reading response files in the flang driver. Response files contain command line arguments and are used whenever a command becomes longer than the shell/environment limit. Response files are recognized via the special "@path/to/response/file.rsp" syntax, which distinguishes them from other file inputs. This patch hardcodes GNU tokenization, since we don't have a CL mode for the driver. In the future we might want to add a --rsp-quoting command line option, like clang has, to accommodate Windows platforms. Differential Revision: https://reviews.llvm.org/D124846
18 lines
479 B
Fortran
18 lines
479 B
Fortran
! Test that the driver can process response files.
|
|
|
|
! RUN: echo "-DTEST" > %basename_t.rsp
|
|
! RUN: %flang -E -cpp @%basename_t.rsp %s -o - | FileCheck %s
|
|
! RUN: %flang_fc1 -E -cpp @%basename_t.rsp %s -o - | FileCheck %s
|
|
! RUN: not %flang %basename_t.rsp %s -o /dev/null
|
|
! RUN: not %flang_fc1 %basenamt_t.rsp %s -o /dev/null
|
|
|
|
! CHECK-LABEL: program test
|
|
! CHECK: end program
|
|
|
|
#ifdef TEST
|
|
program test
|
|
end program
|
|
#else
|
|
We should have read the define from the response file.
|
|
#endif
|