2013-07-23 18:47:01 +08:00
|
|
|
RUN: rm -f %t.a
|
|
|
|
RUN: llvm-ar rcs %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s
|
2013-07-23 18:47:01 +08:00
|
|
|
|
|
|
|
CHECK: Archive map
|
|
|
|
CHECK-NEXT: main in trivial-object-test.elf-x86-64
|
|
|
|
CHECK-NEXT: foo in trivial-object-test2.elf-x86-64
|
|
|
|
CHECK-NEXT: main in trivial-object-test2.elf-x86-64
|
|
|
|
CHECK-NOT: bar
|
|
|
|
|
|
|
|
CHECK: trivial-object-test.elf-x86-64:
|
2014-05-10 07:57:49 +08:00
|
|
|
CHECK-NEXT: U SomeOtherFunction
|
|
|
|
CHECK-NEXT: 0000000000000000 T main
|
|
|
|
CHECK-NEXT: U puts
|
2014-06-21 05:29:27 +08:00
|
|
|
|
|
|
|
CHECK: trivial-object-test2.elf-x86-64:
|
2014-05-10 07:57:49 +08:00
|
|
|
CHECK-NEXT: 0000000000000000 t bar
|
|
|
|
CHECK-NEXT: 0000000000000006 T foo
|
|
|
|
CHECK-NEXT: 0000000000000016 T main
|
2013-07-29 20:40:31 +08:00
|
|
|
|
|
|
|
RUN: rm -f %t.a
|
|
|
|
RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP
|
2013-07-29 20:40:31 +08:00
|
|
|
|
|
|
|
NOMAP-NOT: Archive map
|
|
|
|
|
|
|
|
RUN: llvm-ar s %t.a
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s
|
2013-07-29 20:40:31 +08:00
|
|
|
|
|
|
|
check that the archive does have a corrupt symbol table.
|
|
|
|
RUN: rm -f %t.a
|
|
|
|
RUN: cp %p/Inputs/archive-test.a-corrupt-symbol-table %t.a
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT
|
2013-07-29 20:40:31 +08:00
|
|
|
|
|
|
|
CORRUPT: Archive map
|
|
|
|
CORRUPT-NEXT: mbin in trivial-object-test.elf-x86-64
|
|
|
|
CORRUPT-NEXT: foo in trivial-object-test2.elf-x86-64
|
|
|
|
CORRUPT-NEXT: main in trivial-object-test2.elf-x86-64
|
|
|
|
|
|
|
|
CORRUPT: trivial-object-test.elf-x86-64:
|
2014-05-10 07:57:49 +08:00
|
|
|
CORRUPT-NEXT: U SomeOtherFunction
|
|
|
|
CORRUPT-NEXT: 0000000000000000 T main
|
|
|
|
CORRUPT-NEXT: U puts
|
2014-06-21 05:29:27 +08:00
|
|
|
|
|
|
|
CORRUPT: trivial-object-test2.elf-x86-64:
|
2014-05-10 07:57:49 +08:00
|
|
|
CORRUPT-NEXT: 0000000000000000 t bar
|
|
|
|
CORRUPT-NEXT: 0000000000000006 T foo
|
|
|
|
CORRUPT-NEXT: 0000000000000016 T main
|
2013-07-29 20:40:31 +08:00
|
|
|
|
|
|
|
check that the we *don't* update the symbol table.
|
|
|
|
RUN: llvm-ar s %t.a
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=CORRUPT
|
2013-08-29 00:22:16 +08:00
|
|
|
|
|
|
|
repeate the test with llvm-ranlib
|
|
|
|
|
|
|
|
RUN: rm -f %t.a
|
|
|
|
RUN: llvm-ar rcS %t.a %p/Inputs/trivial-object-test.elf-x86-64 %p/Inputs/trivial-object-test2.elf-x86-64
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s --check-prefix=NOMAP
|
2013-08-29 00:22:16 +08:00
|
|
|
|
|
|
|
RUN: llvm-ranlib %t.a
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %t.a | FileCheck %s
|
2014-07-09 06:10:02 +08:00
|
|
|
|
2014-07-09 07:47:31 +08:00
|
|
|
RUN: llvm-nm -M %p/Inputs/macho-archive-x86_64.a | FileCheck %s --check-prefix=BSD-MachO
|
2014-11-12 09:37:45 +08:00
|
|
|
RUN: llvm-nm -M %p/Inputs/macho-archive-unsorted-x86_64.a | FileCheck %s --check-prefix=BSD-MachO
|
2014-07-09 06:10:02 +08:00
|
|
|
|
|
|
|
BSD-MachO: Archive map
|
|
|
|
BSD-MachO: _bar in bar.o
|
|
|
|
BSD-MachO: _foo in foo.o
|