diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Object/Inputs/archive-test.a-corrupt-symbol-table | bin | 0 -> 2792 bytes | |||
-rw-r--r-- | test/Object/archive-symtab.test | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/test/Object/Inputs/archive-test.a-corrupt-symbol-table b/test/Object/Inputs/archive-test.a-corrupt-symbol-table Binary files differnew file mode 100644 index 0000000000..34e5ed799d --- /dev/null +++ b/test/Object/Inputs/archive-test.a-corrupt-symbol-table diff --git a/test/Object/archive-symtab.test b/test/Object/archive-symtab.test index 1cf0ce449d..0d2504d256 100644 --- a/test/Object/archive-symtab.test +++ b/test/Object/archive-symtab.test @@ -16,3 +16,35 @@ CHECK-NEXT: trivial-object-test2.elf-x86-64: CHECK-NEXT: 00000000 t bar CHECK-NEXT: 00000006 T foo CHECK-NEXT: 00000016 T main + +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 +RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=NOMAP + +NOMAP-NOT: Archive map + +RUN: llvm-ar s %t.a +RUN: llvm-nm -s %t.a | FileCheck %s + +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 +RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT + +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: +CORRUPT-NEXT: U SomeOtherFunction +CORRUPT-NEXT: 00000000 T main +CORRUPT-NEXT: U puts +CORRUPT-NEXT: trivial-object-test2.elf-x86-64: +CORRUPT-NEXT: 00000000 t bar +CORRUPT-NEXT: 00000006 T foo +CORRUPT-NEXT: 00000016 T main + +check that the we *don't* update the symbol table. +RUN: llvm-ar s %t.a +RUN: llvm-nm -s %t.a | FileCheck %s --check-prefix=CORRUPT |