2 RUN: llvm-ar rcs %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
3 RUN: llvm-nm -M %t.a | FileCheck %s
6 CHECK-NEXT: main in trivial-object-test.elf-x86-64
7 CHECK-NEXT: foo in trivial-object-test2.elf-x86-64
8 CHECK-NEXT: main in trivial-object-test2.elf-x86-64
11 CHECK: trivial-object-test.elf-x86-64:
12 CHECK-NEXT: U SomeOtherFunction
13 CHECK-NEXT: 0000000000000000 T main
16 CHECK: trivial-object-test2.elf-x86-64:
17 CHECK-NEXT: 0000000000000000 t bar
18 CHECK-NEXT: 0000000000000006 T foo
19 CHECK-NEXT: 0000000000000016 T main
22 RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
23 RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP
25 NOMAP-NOT: Archive map
28 RUN: llvm-nm -M %t.a | FileCheck %s
30 check that the archive does have a corrupt symbol table.
32 RUN: cp %p/Inputs/archive-test.a-corrupt-symbol-table %t.a
33 RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT
36 CORRUPT-NEXT: mbin in trivial-object-test.elf-x86-64
37 CORRUPT-NEXT: foo in trivial-object-test2.elf-x86-64
38 CORRUPT-NEXT: main in trivial-object-test2.elf-x86-64
40 CORRUPT: trivial-object-test.elf-x86-64:
41 CORRUPT-NEXT: U SomeOtherFunction
42 CORRUPT-NEXT: 0000000000000000 T main
45 CORRUPT: trivial-object-test2.elf-x86-64:
46 CORRUPT-NEXT: 0000000000000000 t bar
47 CORRUPT-NEXT: 0000000000000006 T foo
48 CORRUPT-NEXT: 0000000000000016 T main
50 check that the we *don't* update the symbol table.
52 RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT
54 repeate the test with llvm-ranlib
57 RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
58 RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP
61 RUN: llvm-nm -M %t.a | FileCheck %s
63 RUN: llvm-nm -M %p/Inputs/macho-archive-x86_64.a | FileCheck %s --check-prefix=BSD-MachO
64 RUN: llvm-nm -M %p/Inputs/macho-archive-unsorted-x86_64.a | FileCheck %s --check-prefix=BSD-MachO
66 BSD-MachO: Archive map
67 BSD-MachO: _bar in bar.o
68 BSD-MachO: _foo in foo.o
71 RUN: llvm-ar --format=bsd rcs %t.a %p/Inputs/trivial-object-test.macho-x86-64 %p/Inputs/trivial-object-test2.macho-x86-64
72 RUN: llvm-nm -M %t.a | FileCheck --check-prefix=MACHO %s
75 MACHO-NEXT: _main in trivial-object-test.macho-x86-64
76 MACHO-NEXT: _foo in trivial-object-test2.macho-x86-64
77 MACHO-NEXT: _main in trivial-object-test2.macho-x86-64
80 MACHO: trivial-object-test.macho-x86-64
81 MACHO-NEXT: 0000000000000028 s L_.str
82 MACHO-NEXT: U _SomeOtherFunction
83 MACHO-NEXT: 0000000000000000 T _main
86 MACHO: trivial-object-test2.macho-x86-64
87 MACHO-NEXT: 0000000000000000 t _bar
88 MACHO-NEXT: 0000000000000001 T _foo
89 MACHO-NEXT: 0000000000000002 T _main
91 Test that we pad the symbol table so that it ends in a multiple of 4 bytes:
94 RUN: llvm-ar --format=bsd rcs %t.a %p/Inputs/trivial-object-test.macho-x86-64
95 RUN: FileCheck --check-prefix=MACHO-SYMTAB-ALIGN %s < %t.a
96 MACHO-SYMTAB-ALIGN: !<arch>
97 MACHO-SYMTAB-ALIGN-NEXT: #1/12 {{..........}} 0 0 0 36 `