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