[mips][mips64r6] jalx is not available on MIPS32r6/MIPS64r6
[oota-llvm.git] / test / Object / archive-symtab.test
1 RUN: rm -f %t.a
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 -s %t.a | FileCheck %s
4
5 CHECK: Archive map
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
9 CHECK-NOT: bar
10
11 CHECK: trivial-object-test.elf-x86-64:
12 CHECK-NEXT:                  U SomeOtherFunction
13 CHECK-NEXT: 0000000000000000 T main
14 CHECK-NEXT:                  U puts
15 CHECK-NEXT: trivial-object-test2.elf-x86-64:
16 CHECK-NEXT: 0000000000000000 t bar
17 CHECK-NEXT: 0000000000000006 T foo
18 CHECK-NEXT: 0000000000000016 T main
19
20 RUN: rm -f %t.a
21 RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
22 RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=NOMAP
23
24 NOMAP-NOT: Archive map
25
26 RUN: llvm-ar s %t.a
27 RUN: llvm-nm -s %t.a | FileCheck %s
28
29 check that the archive does have a corrupt symbol table.
30 RUN: rm -f %t.a
31 RUN: cp %p/Inputs/archive-test.a-corrupt-symbol-table %t.a
32 RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT
33
34 CORRUPT: Archive map
35 CORRUPT-NEXT: mbin in trivial-object-test.elf-x86-64
36 CORRUPT-NEXT: foo in trivial-object-test2.elf-x86-64
37 CORRUPT-NEXT: main in trivial-object-test2.elf-x86-64
38
39 CORRUPT: trivial-object-test.elf-x86-64:
40 CORRUPT-NEXT:                  U SomeOtherFunction
41 CORRUPT-NEXT: 0000000000000000 T main
42 CORRUPT-NEXT:                  U puts
43 CORRUPT-NEXT: trivial-object-test2.elf-x86-64:
44 CORRUPT-NEXT: 0000000000000000 t bar
45 CORRUPT-NEXT: 0000000000000006 T foo
46 CORRUPT-NEXT: 0000000000000016 T main
47
48 check that the we *don't* update the symbol table.
49 RUN: llvm-ar s %t.a
50 RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT
51
52 repeate the test with llvm-ranlib
53
54 RUN: rm -f %t.a
55 RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
56 RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=NOMAP
57
58 RUN: llvm-ranlib %t.a
59 RUN: llvm-nm -s %t.a | FileCheck %s