• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## llvm-ar should be able to consume response files.
2
3# RUN: echo 'contents' > %t.txt
4# RUN: echo 'rc %t1.a %t.txt' > %t.response1.txt
5# RUN: llvm-ar @%t.response1.txt
6# RUN: llvm-ar p %t1.a | FileCheck %s --check-prefix=CONTENTS
7
8## Quotes and Spaces.
9# RUN: echo 'contents' > '%t space.txt'
10## Python is used here to ensure the quotes are written to the response file
11# RUN: %python -c "import os; open(r'%t.response2.txt', 'w').write(r'%t2.a \"%t space.txt\"'+ '\n')"
12# RUN: llvm-ar rc @%t.response2.txt
13# RUN: llvm-ar p %t2.a | FileCheck %s --check-prefix=CONTENTS
14
15## Arguments after the response file.
16# RUN: echo 'rc %t3.a' > %t.response3.txt
17# RUN: llvm-ar @%t.response3.txt %t.txt
18# RUN: llvm-ar p %t3.a | FileCheck %s --check-prefix=CONTENTS
19
20## Newlines
21# RUN: echo contents > %t.txt
22# RUN: echo rc %t4.a > %t.newline.txt
23# RUN: echo %t.txt >> %t.newline.txt
24# RUN: llvm-ar @%t.newline.txt
25# RUN: llvm-ar p %t4.a | FileCheck %s --check-prefix=CONTENTS
26
27# CONTENTS: contents
28
29## rsp-quoting
30# RUN: not llvm-ar --rsp-quoting=foobar @%t.response1.txt 2>&1 | \
31# RUN:   FileCheck  %s --check-prefix=ERROR
32# ERROR: Invalid response file quoting style foobar
33
34# RUN: echo -e 'rc %/t.a blah\\foo' > %t-rsp.txt
35# RUN: not llvm-ar --rsp-quoting=windows @%t-rsp.txt 2>&1 | \
36# RUN:   FileCheck %s --check-prefix=WIN
37# WIN: error: blah\foo: {{[Nn]}}o such file or directory
38
39# RUN: not llvm-ar -rsp-quoting posix @%t-rsp.txt 2>&1 | \
40# RUN:   FileCheck %s --check-prefix=POSIX
41# POSIX: error: blahfoo: {{[Nn]}}o such file or directory
42