• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Test inserting files before a file.
2
3RUN: touch %t1.txt
4RUN: touch %t2.txt
5RUN: touch %t3.txt
6RUN: touch %t4.txt
7
8# Insert one file:
9RUN: rm -f %t-one.a
10RUN: llvm-ar rc %t-one.a %t1.txt %t2.txt
11RUN: llvm-ar rb %t2.txt %t-one.a %t3.txt
12RUN: llvm-ar t %t-one.a | FileCheck %s --check-prefix=ONE
13
14ONE:      1.txt
15ONE-NEXT: 3.txt
16ONE-NEXT: 2.txt
17
18# Insert file at front:
19RUN: rm -f %t-front.a
20RUN: llvm-ar rc %t-front.a %t1.txt %t2.txt
21RUN: llvm-ar rb %t1.txt %t-front.a %t3.txt
22RUN: llvm-ar t %t-front.a | FileCheck %s --check-prefix=FRONT
23
24FRONT:      3.txt
25FRONT-NEXT: 1.txt
26FRONT-NEXT: 2.txt
27
28# Insert multiple files:
29RUN: rm -f %t-multiple.a
30RUN: llvm-ar rc %t-multiple.a %t1.txt %t2.txt
31RUN: llvm-ar rb %t2.txt %t-multiple.a %t4.txt %t3.txt
32RUN: llvm-ar t %t-multiple.a | FileCheck %s --check-prefix=MULTIPLE
33
34MULTIPLE:      1.txt
35MULTIPLE-NEXT: 4.txt
36MULTIPLE-NEXT: 3.txt
37MULTIPLE-NEXT: 2.txt
38
39# Insert before an invalid file:
40RUN: rm -f %t-invalid.a
41RUN: llvm-ar rc %t-invalid.a %t1.txt %t2.txt %t3.txt
42RUN: not llvm-ar rb invalid.txt %t-invalid.a %t2.txt 2>&1 \
43RUN:   | FileCheck %s --check-prefix=ERROR
44RUN: llvm-ar t %t-invalid.a | FileCheck %s --check-prefix=INVALID
45
46ERROR: error: insertion point not found
47INVALID:      1.txt
48INVALID-NEXT: 2.txt
49INVALID-NEXT: 3.txt
50
51# Insert file at the same position:
52RUN: rm -f %t-position.a
53RUN: llvm-ar rc %t-position.a %t1.txt %t2.txt %t3.txt
54RUN: llvm-ar rb %t3.txt %t-position.a %t2.txt
55RUN: llvm-ar t %t-position.a | FileCheck %s --check-prefix=POSITION
56
57POSITION:      1.txt
58POSITION-NEXT: 2.txt
59POSITION-NEXT: 3.txt
60