Find the symbol table on archives created on OS X.
[oota-llvm.git] / test / Object / nm-archive.test
1 RUN: llvm-nm %p/Inputs/archive-test.a-coff-i386 \
2 RUN:         | FileCheck %s -check-prefix COFF
3
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
12
13 RUN: llvm-as %p/Inputs/trivial.ll -o=%t1
14 RUN: rm -f %t2
15 RUN: llvm-ar rcs %t2 %t1
16 RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
17
18 BITCODE:          U SomeOtherFunction
19 BITCODE-NEXT:          T main
20 BITCODE-NEXT:          U puts
21
22
23 Test we don't error with an archive with no symtab.
24 RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
25
26
27 Or in an archive with no symtab or string table.
28 RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
29
30
31 And don't crash when asked to print a non existing symtab.
32 RUN: llvm-nm -s %p/Inputs/archive-test.a-gnu-minimal
33
34
35 Test that we at least find the symbol table on an OS X archive. Please update
36 this when we are actually able to parse it.
37 RUN: not llvm-nm -s %p/Inputs/MacOSX.a 2>&1 | FileCheck %s -check-prefix OSX
38
39 OSX: BSD archive format is not supported