• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
27RUN: rm -f %t2
28RUN: llvm-lib /out:%t2 %t1
29RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
30
31RUN: rm -f %t2
32RUN: echo /out:%t2 %t1 > %t.rsp
33RUN: llvm-lib @%t.rsp
34RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
35
36BITCODE:          U SomeOtherFunction
37BITCODE-NEXT:          T main
38BITCODE-NEXT:          U puts
39BITCODE-NEXT:          D var
40
41
42Test we don't error with an archive with no symtab.
43RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
44
45
46Or in an archive with no symtab or string table.
47RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
48
49
50And don't crash when asked to print a non-existing symtab.
51RUN: llvm-nm -M %p/Inputs/archive-test.a-gnu-minimal
52
53Don't reject an empty archive.
54RUN: llvm-nm %p/Inputs/archive-test.a-empty
55
56This archive has an unaligned member and a unknown format member.
57GNU AR is able to parse the unaligned member and warns about the member with
58the unknown format. We should probably simply warn on both. For now we just
59produce an error for the unknown format.
60RUN: not llvm-nm %p/Inputs/corrupt-archive.a 2>&1 | FileCheck %s -check-prefix CORRUPT
61CORRUPT: corrupt-archive.a(trivial-object-test2.elf-x86-64) Invalid data was encountered while parsing the file
62
63
64RUN: llvm-nm %p/Inputs/thin.a | FileCheck %s -check-prefix THIN
65
66THIN: IsNAN.o:
67THIN: 00000014 T _ZN4llvm5IsNANEd
68THIN: 00000000 T _ZN4llvm5IsNANEf
69THIN:          U __isnan
70THIN:          U __isnanf
71