blob: 9cb84b28d29693d4075c014874d1c072c086ecc8 [file] [log] [blame]
Matt Beaumont-Gay1c1a2b82011-10-31 23:56:52 +00001RUN: llvm-nm %p/Inputs/archive-test.a-coff-i386 \
Michael J. Spencer2bc774a2011-09-27 19:37:18 +00002RUN: | FileCheck %s -check-prefix COFF
Rafael Espindola88ae7dd2013-07-03 15:57:14 +00003
Michael J. Spencer2bc774a2011-09-27 19:37:18 +00004COFF: 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
Rafael Espindolafbcafc02013-07-10 20:14:22 +000012
13RUN: llvm-as %p/Inputs/trivial.ll -o=%t1
14RUN: rm -f %t2
15RUN: llvm-ar rcs %t2 %t1
16RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
17
Michael J. Spencer2bc774a2011-09-27 19:37:18 +000018BITCODE: U SomeOtherFunction
19BITCODE-NEXT: T main
20BITCODE-NEXT: U puts
Rafael Espindolab674c172014-07-04 15:03:17 +000021BITCODE-NEXT: D var
Rafael Espindolafbcafc02013-07-10 20:14:22 +000022
23
24Test we don't error with an archive with no symtab.
25RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
26
27
28Or in an archive with no symtab or string table.
29RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
30
31
Alp Tokerf907b892013-12-05 05:44:44 +000032And don't crash when asked to print a non-existing symtab.
Rafael Espindolafbcafc02013-07-10 20:14:22 +000033RUN: llvm-nm -s %p/Inputs/archive-test.a-gnu-minimal
Rafael Espindolaf0c61722013-07-12 13:32:28 +000034
35Don't reject an empty archive.
36RUN: llvm-nm %p/Inputs/archive-test.a-empty
Rafael Espindola95cf2f22014-06-16 16:41:00 +000037
38This archive has an unaligned member and a unknown format member.
39GNU AR is able to parse the unaligned member and warns about the member with
40the unknown format. We should probably simply warn on both. For now just check
41that we don't produce an error.
42RUN: llvm-nm %p/Inputs/corrupt-archive.a