diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-10 20:14:22 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-10 20:14:22 +0000 |
commit | 5159718095bd8a18c1661889e93af3aca8eaa5aa (patch) | |
tree | 0404298ed72edcfe60e8fb18c6d9a14bb3962909 /test | |
parent | ed094c32ff2683c07d8eec558ee9defa4f0c00f6 (diff) | |
download | external_llvm-5159718095bd8a18c1661889e93af3aca8eaa5aa.zip external_llvm-5159718095bd8a18c1661889e93af3aca8eaa5aa.tar.gz external_llvm-5159718095bd8a18c1661889e93af3aca8eaa5aa.tar.bz2 |
Don't crash in 'llvm -s' when an archive has no symtab.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Object/nm-archive.test | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/test/Object/nm-archive.test b/test/Object/nm-archive.test index 922983c..99efc1b 100644 --- a/test/Object/nm-archive.test +++ b/test/Object/nm-archive.test @@ -1,25 +1,32 @@ RUN: llvm-nm %p/Inputs/archive-test.a-coff-i386 \ RUN: | FileCheck %s -check-prefix COFF +COFF: trivial-object-test.coff-i386: +COFF-NEXT: 00000000 d .data +COFF-NEXT: 00000000 t .text +COFF-NEXT: 00000000 d L_.str +COFF-NEXT: U _SomeOtherFunction +COFF-NEXT: 00000000 T _main +COFF-NEXT: U _puts + + RUN: llvm-as %p/Inputs/trivial.ll -o=%t1 RUN: rm -f %t2 RUN: llvm-ar rcs %t2 %t1 RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE +BITCODE: U SomeOtherFunction +BITCODE-NEXT: T main +BITCODE-NEXT: U puts + + Test we don't error with an archive with no symtab. RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab + Or in an archive with no symtab or string table. RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal -COFF: trivial-object-test.coff-i386: -COFF-NEXT: 00000000 d .data -COFF-NEXT: 00000000 t .text -COFF-NEXT: 00000000 d L_.str -COFF-NEXT: U _SomeOtherFunction -COFF-NEXT: 00000000 T _main -COFF-NEXT: U _puts -BITCODE: U SomeOtherFunction -BITCODE-NEXT: T main -BITCODE-NEXT: U puts +And don't crash when asked to print a non existing symtab. +RUN: llvm-nm -s %p/Inputs/archive-test.a-gnu-minimal |