nm-archive.test 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. RUN: llvm-nm -a %p/Inputs/archive-test.a-coff-i386 \
  2. RUN: | FileCheck %s -check-prefix COFF
  3. COFF: trivial-object-test.coff-i386:
  4. COFF-NEXT: 00000000 d .data
  5. COFF-NEXT: 00000000 t .text
  6. COFF-NEXT: 00000000 d L_.str
  7. COFF-NEXT: U _SomeOtherFunction
  8. COFF-NEXT: 00000000 T _main
  9. COFF-NEXT: U _puts
  10. RUN: llvm-nm -a -o %p/Inputs/archive-test.a-coff-i386 \
  11. RUN: | FileCheck %s -check-prefix COFF-o
  12. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d .data
  13. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 t .text
  14. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 d L_.str
  15. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _SomeOtherFunction
  16. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: 00000000 T _main
  17. COFF-o: {{.*}}/archive-test.a-coff-i386:trivial-object-test.coff-i386: U _puts
  18. RUN: llvm-as %p/Inputs/trivial.ll -o=%t1
  19. RUN: rm -f %t2
  20. RUN: llvm-ar rcs %t2 %t1
  21. RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
  22. RUN: rm -f %t2
  23. RUN: llvm-lib /out:%t2 %t1
  24. RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
  25. RUN: rm -f %t2
  26. RUN: echo /out:%t2 %t1 > %t.rsp
  27. RUN: llvm-lib @%t.rsp
  28. RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
  29. BITCODE: U SomeOtherFunction
  30. BITCODE-NEXT: T main
  31. BITCODE-NEXT: U puts
  32. BITCODE-NEXT: D var
  33. Test we don't error with an archive with no symtab.
  34. RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
  35. Or in an archive with no symtab or string table.
  36. RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
  37. And don't crash when asked to print a non-existing symtab.
  38. RUN: llvm-nm -M %p/Inputs/archive-test.a-gnu-minimal
  39. Don't reject an empty archive.
  40. RUN: llvm-nm %p/Inputs/archive-test.a-empty
  41. This archive has an unaligned member and a unknown format member.
  42. GNU AR is able to parse the unaligned member and warns about the member with
  43. the unknown format. We should probably simply warn on both. For now just check
  44. that we don't produce an error.
  45. RUN: llvm-nm %p/Inputs/corrupt-archive.a