blob: 376eb053c6d2e3ca8aaa5a4a807a9e20842aded8 [file] [log] [blame]
Rafael Espindola0aac01b2013-07-13 04:14:13 +00001Test the exact archive format. In particular, test which file names use the
2string table or not.
3
Rafael Espindola0aac01b2013-07-13 04:14:13 +00004RUN: mkdir -p %t
5RUN: cd %t
6
NAKAMURA Takumi10d576d2015-03-03 15:54:48 +00007RUN: echo -n bar. > 0123456789abcde
8RUN: echo -n zed. > 0123456789abcdef
Rafael Espindola0aac01b2013-07-13 04:14:13 +00009
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000010RUN: rm -f %t.a
11RUN: llvm-ar --format=gnu rc %t.a 0123456789abcde 0123456789abcdef
12RUN: cat %t.a | FileCheck -strict-whitespace %s
Rafael Espindola0aac01b2013-07-13 04:14:13 +000013
14CHECK: !<arch>
15CHECK-NEXT: // 18 `
16CHECK-NEXT: 0123456789abcdef/
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000017CHECK-NEXT: 0123456789abcde/0 0 0 644 4 `
18CHECK-NEXT: bar./0 0 0 0 644 4 `
NAKAMURA Takumi10d576d2015-03-03 15:54:48 +000019CHECK-NEXT: zed.
Rafael Espindolaa2ed0b02015-07-08 20:47:32 +000020
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000021RUN: rm -f %t.a
22RUN: llvm-ar --format=bsd rc %t.a 0123456789abcde 0123456789abcdef
23RUN: cat %t.a | FileCheck -strict-whitespace --check-prefix=BSD %s
Rafael Espindolaa2ed0b02015-07-08 20:47:32 +000024
25BSD: !<arch>
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000026BSD-NEXT: #1/20 0 0 0 644 24 `
Rafael Espindolaa2ed0b02015-07-08 20:47:32 +000027BSD-NEXT: 0123456789abcde{{.....}}bar.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000028BSD-SAME: #1/16 0 0 0 644 20 `
Rafael Espindolaa2ed0b02015-07-08 20:47:32 +000029BSD-NEXT: 0123456789abcdefzed.
Rafael Espindolae6492582015-07-15 05:47:46 +000030
31RUN: rm -f %t.a
32RUN: llvm-ar --format=gnu rcT %t.a 0123456789abcde 0123456789abcdef
33RUN: cat %t.a | FileCheck -strict-whitespace --check-prefix=THIN %s
34THIN: !<thin>
35THIN-NEXT: // 36 `
36THIN-NEXT: 0123456789abcde/
37THIN-NEXT: 0123456789abcdef/{{$}}
38THIN: {{^$}}
39THIN: /0 0 0 0 644 4 `
40THIN-NEXT: /17 0 0 0 644 4 `