Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-ar] Fix llvm-ar response file reading on Windows
Response files where not being correctly read on Windows, this change fixes the issue and adds some tests. Differential Revision: https://reviews.llvm.org/D69665
- Loading branch information
Showing
3 changed files
with
139 additions
and
47 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,11 @@ | ||
## Check that response files can cope with non-ascii characters. | ||
|
||
# RUN: echo 'contents' > %t-£.txt | ||
|
||
# RUN: rm -f %t-£.a | ||
# RUN: echo 'r %t-£.a %t-£.txt' > %t-replace.txt | ||
# RUN: llvm-ar @%t-replace.txt | ||
|
||
# RUN: echo 'p %t-£.a %t-£.txt' > %t-print.txt | ||
# RUN: llvm-ar @%t-print.txt | FileCheck %s | ||
# CHECK: contents |
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,34 @@ | ||
## llvm-ar should be able to consume response files. | ||
|
||
# RUN: echo 'contents' > %t.txt | ||
# RUN: echo 'rc %t1.a %t.txt' > %t.response1.txt | ||
# RUN: llvm-ar @%t.response1.txt | ||
# RUN: llvm-ar p %t1.a | FileCheck %s --check-prefix=CONTENTS | ||
|
||
## Quotes and Spaces. | ||
# RUN: echo 'contents' > '%t space.txt' | ||
## Python is used here to ensure the quotes are written to the response file | ||
# RUN: %python -c "import os; open(r'%t.response2.txt', 'w').write(r'%t2.a \"%t space.txt\"'+ '\n')" | ||
# RUN: llvm-ar rc @%t.response2.txt | ||
# RUN: llvm-ar p %t2.a | FileCheck %s --check-prefix=CONTENTS | ||
|
||
## Arguments after the response file. | ||
# RUN: echo 'rc %t3.a' > %t.response3.txt | ||
# RUN: llvm-ar @%t.response3.txt %t.txt | ||
# RUN: llvm-ar p %t3.a | FileCheck %s --check-prefix=CONTENTS | ||
|
||
# CONTENTS: contents | ||
|
||
## rsp-quoting | ||
# RUN: not llvm-ar --rsp-quoting=foobar @%t.response1.txt 2>&1 | \ | ||
# RUN: FileCheck %s --check-prefix=ERROR | ||
# ERROR: Invalid response file quoting style foobar | ||
|
||
# RUN: echo -e 'rc %/t.a blah\\foo' > %t-rsp.txt | ||
# RUN: not llvm-ar --rsp-quoting=windows @%t-rsp.txt 2>&1 | \ | ||
# RUN: FileCheck %s --check-prefix=WIN | ||
# WIN: error: blah\foo: {{[Nn]}}o such file or directory | ||
|
||
# RUN: not llvm-ar -rsp-quoting posix @%t-rsp.txt 2>&1 | \ | ||
# RUN: FileCheck %s --check-prefix=POSIX | ||
# POSIX: error: blahfoo: {{[Nn]}}o such file or directory |
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