Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][driver] Support parsing response files
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
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
! 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters