• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Test the exact archive format. In particular, test which file names use the
2string table or not.
3
4RUN: mkdir -p %t
5RUN: cd %t
6
7RUN: echo -n bar. > 0123456789abcde
8RUN: echo -n zed. > 0123456789abcdef
9RUN: mkdir -p foo
10RUN: echo -n bar2 > foo/0123456789abcde
11RUN: echo -n zed2 > foo/0123456789abcdef
12
13RUN: rm -f %t.a
14RUN: llvm-ar --format=gnu rc %t.a 0123456789abcde 0123456789abcdef foo/0123456789abcde foo/0123456789abcdef
15RUN: cat %t.a | FileCheck -strict-whitespace %s
16
17CHECK:      !<arch>
18CHECK-NEXT: //                                              36        `
19CHECK-NEXT: 0123456789abcdef/
20CHECK-NEXT: 0123456789abcdef/
21CHECK-NEXT: 0123456789abcde/0           0     0     644     4         `
22CHECK-NEXT: bar.
23CHECK-SAME: /0              0           0     0     644     4         `
24CHECK-NEXT: zed.
25CHECK-SAME: 0123456789abcde/0           0     0     644     4         `
26CHECK-NEXT: bar2
27CHECK-SAME: /18             0           0     0     644     4         `
28CHECK-NEXT: zed2
29
30RUN: rm -f %t.a
31RUN: llvm-ar --format=bsd rc %t.a 0123456789abcde 0123456789abcdef
32RUN: cat %t.a | FileCheck -strict-whitespace --check-prefix=BSD %s
33
34BSD:      !<arch>
35BSD-NEXT: #1/20           0           0     0     644     24        `
36BSD-NEXT: 0123456789abcde{{.....}}bar.
37BSD-SAME: #1/16           0           0     0     644     20        `
38BSD-NEXT: 0123456789abcdefzed.
39
40RUN: rm -f test.a
41RUN: llvm-ar --format=gnu rcT test.a 0123456789abcde 0123456789abcdef
42RUN: cat test.a | FileCheck -strict-whitespace --check-prefix=THIN %s
43THIN: !<thin>
44THIN-NEXT: //                                              36        `
45THIN-NEXT: 0123456789abcde/
46THIN-NEXT: 0123456789abcdef/{{$}}
47THIN: {{^$}}
48THIN: /0              0           0     0     644     4         `
49THIN-NEXT: /17             0           0     0     644     4         `
50
51RUN: mkdir -p bar
52RUN: rm -f bar/test.a
53RUN: llvm-ar --format=gnu rcT bar/test.a 0123456789abcde 0123456789abcdef foo/0123456789abcde foo/0123456789abcdef
54RUN: cat bar/test.a | FileCheck -strict-whitespace --check-prefix=THIN-PATH %s
55THIN-PATH: !<thin>
56THIN-PATH-NEXT: //                                              90        `
57THIN-PATH-NEXT: ..{{/|\\}}0123456789abcde/
58THIN-PATH-NEXT: ..{{/|\\}}0123456789abcdef/
59THIN-PATH-NEXT: ..{{/|\\}}foo{{/|\\}}0123456789abcde/
60THIN-PATH-NEXT: ..{{/|\\}}foo{{/|\\}}0123456789abcdef/
61THIN-PATH-NEXT: /0              0           0     0     644     4         `
62THIN-PATH-NEXT: /20             0           0     0     644     4         `
63THIN-PATH-NEXT: /41             0           0     0     644     4         `
64THIN-PATH-NEXT: /65             0           0     0     644     4         `
65
66RUN: not llvm-ar --format=bsd rcT bad.a 0123456789abcde 0123456789abcdef 2>&1 | FileCheck --check-prefix=BSD-THIN %s
67BSD-THIN: Only the gnu format has a thin mode.
68