Files
clang-p2996/llvm/test/tools/llvm-ar/response.test
gbreynoo 5e0f9d5d3c [llvm-ar][test] Add to llvm-ar test coverage
- Added handling of thin archives to symtab.test.
- Added handling of newlines to response.test.
- 62fa3332c9 exposed behaviour
  regarding the use of -- on the command line. Added
  double-hyphen.test to cover this.

Differential Revision: https://reviews.llvm.org/D73333
2020-03-04 10:56:48 +00:00

42 lines
1.5 KiB
Plaintext

## 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
## Newlines
# RUN: echo contents > %t.txt
# RUN: echo rc %t4.a > %t.newline.txt
# RUN: echo %t.txt >> %t.newline.txt
# RUN: llvm-ar @%t.newline.txt
# RUN: llvm-ar p %t4.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