1RUN: llvm-nm -a %p/Inputs/archive-test.a-coff-i386 \
2RUN:         | FileCheck %s -check-prefix COFF
3
4COFF: trivial-object-test.coff-i386:
5COFF-NEXT: 00000000 d .data
6COFF-NEXT: 00000000 t .text
7COFF-NEXT: 00000000 d L_.str
8COFF-NEXT:          U _SomeOtherFunction
9COFF-NEXT: 00000000 T _main
10COFF-NEXT:          U _puts
11
12RUN: llvm-nm -a -o %p/Inputs/archive-test.a-coff-i386 \
13RUN:         | FileCheck %s -check-prefix COFF-o
14
15COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d .data
16COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 t .text
17COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d L_.str
18COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386:          U _SomeOtherFunction
19COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 T _main
20COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386:          U _puts
21
22RUN: llvm-as %p/Inputs/trivial.ll -o=%t1
23RUN: rm -f %t2
24RUN: llvm-ar rcs %t2 %t1
25RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
26
27BITCODE:          U SomeOtherFunction
28BITCODE-NEXT:          T main
29BITCODE-NEXT:          U puts
30BITCODE-NEXT:          D var
31
32
33Test we don't error with an archive with no symtab.
34RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
35
36
37Or in an archive with no symtab or string table.
38RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
39
40
41And don't crash when asked to print a non-existing symtab.
42RUN: llvm-nm -M %p/Inputs/archive-test.a-gnu-minimal
43
44Don't reject an empty archive.
45RUN: llvm-nm %p/Inputs/archive-test.a-empty
46
47This archive has an unaligned member and a unknown format member.
48GNU AR is able to parse the unaligned member and warns about the member with
49the unknown format. We should probably simply warn on both. For now just check
50that we don't produce an error.
51RUN: llvm-nm %p/Inputs/corrupt-archive.a
52