Matt Beaumont-Gay | 1c1a2b8 | 2011-10-31 23:56:52 +0000 | [diff] [blame] | 1 | RUN: llvm-nm %p/Inputs/archive-test.a-coff-i386 \ |
Michael J. Spencer | 2bc774a | 2011-09-27 19:37:18 +0000 | [diff] [blame] | 2 | RUN: | FileCheck %s -check-prefix COFF |
Rafael Espindola | 88ae7dd | 2013-07-03 15:57:14 +0000 | [diff] [blame] | 3 | |
Michael J. Spencer | 2bc774a | 2011-09-27 19:37:18 +0000 | [diff] [blame] | 4 | COFF: trivial-object-test.coff-i386: |
| 5 | COFF-NEXT: 00000000 d .data |
| 6 | COFF-NEXT: 00000000 t .text |
| 7 | COFF-NEXT: 00000000 d L_.str |
| 8 | COFF-NEXT: U _SomeOtherFunction |
| 9 | COFF-NEXT: 00000000 T _main |
| 10 | COFF-NEXT: U _puts |
| 11 | |
Kevin Enderby | 08e1bbd | 2014-07-24 23:31:52 +0000 | [diff] [blame^] | 12 | RUN: llvm-nm -o %p/Inputs/archive-test.a-coff-i386 \ |
| 13 | RUN: | FileCheck %s -check-prefix COFF-o |
| 14 | |
| 15 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d .data |
| 16 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 t .text |
| 17 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d L_.str |
| 18 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _SomeOtherFunction |
| 19 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 T _main |
| 20 | COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _puts |
Rafael Espindola | fbcafc0 | 2013-07-10 20:14:22 +0000 | [diff] [blame] | 21 | |
| 22 | RUN: llvm-as %p/Inputs/trivial.ll -o=%t1 |
| 23 | RUN: rm -f %t2 |
| 24 | RUN: llvm-ar rcs %t2 %t1 |
| 25 | RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE |
| 26 | |
Michael J. Spencer | 2bc774a | 2011-09-27 19:37:18 +0000 | [diff] [blame] | 27 | BITCODE: U SomeOtherFunction |
| 28 | BITCODE-NEXT: T main |
| 29 | BITCODE-NEXT: U puts |
Rafael Espindola | b674c17 | 2014-07-04 15:03:17 +0000 | [diff] [blame] | 30 | BITCODE-NEXT: D var |
Rafael Espindola | fbcafc0 | 2013-07-10 20:14:22 +0000 | [diff] [blame] | 31 | |
| 32 | |
| 33 | Test we don't error with an archive with no symtab. |
| 34 | RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab |
| 35 | |
| 36 | |
| 37 | Or in an archive with no symtab or string table. |
| 38 | RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal |
| 39 | |
| 40 | |
Alp Toker | f907b89 | 2013-12-05 05:44:44 +0000 | [diff] [blame] | 41 | And don't crash when asked to print a non-existing symtab. |
Kevin Enderby | 8da4bd6 | 2014-07-08 23:47:31 +0000 | [diff] [blame] | 42 | RUN: llvm-nm -M %p/Inputs/archive-test.a-gnu-minimal |
Rafael Espindola | f0c6172 | 2013-07-12 13:32:28 +0000 | [diff] [blame] | 43 | |
| 44 | Don't reject an empty archive. |
| 45 | RUN: llvm-nm %p/Inputs/archive-test.a-empty |
Rafael Espindola | 95cf2f2 | 2014-06-16 16:41:00 +0000 | [diff] [blame] | 46 | |
| 47 | This archive has an unaligned member and a unknown format member. |
| 48 | GNU AR is able to parse the unaligned member and warns about the member with |
| 49 | the unknown format. We should probably simply warn on both. For now just check |
| 50 | that we don't produce an error. |
| 51 | RUN: llvm-nm %p/Inputs/corrupt-archive.a |