archive-extract.test 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ; This test just makes sure that llvm-ar can extract bytecode members
  2. ; from various style archives.
  3. ; RUN: cd %T
  4. ; RUN: rm -f very_long_bytecode_file_name.bc
  5. ; RUN: llvm-ar p %p/Inputs/GNU.a very_long_bytecode_file_name.bc | \
  6. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -
  7. ; RUN: llvm-ar x %p/Inputs/GNU.a very_long_bytecode_file_name.bc
  8. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \
  9. ; RUN: very_long_bytecode_file_name.bc
  10. ; RUN: rm -f very_long_bytecode_file_name.bc
  11. ; RUN: llvm-ar p %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc | \
  12. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -
  13. ; RUN: llvm-ar x %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc
  14. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \
  15. ; RUN: very_long_bytecode_file_name.bc
  16. ; RUN: rm -f very_long_bytecode_file_name.bc
  17. ; RUN: llvm-ar p %p/Inputs/SVR4.a very_long_bytecode_file_name.bc | \
  18. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -
  19. ; RUN: llvm-ar x %p/Inputs/SVR4.a very_long_bytecode_file_name.bc
  20. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \
  21. ; RUN: very_long_bytecode_file_name.bc
  22. ; RUN: rm -f very_long_bytecode_file_name.bc
  23. ; RUN: llvm-ar p %p/Inputs/xpg4.a very_long_bytecode_file_name.bc |\
  24. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -
  25. ; RUN: llvm-ar x %p/Inputs/xpg4.a very_long_bytecode_file_name.bc
  26. ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \
  27. ; RUN: very_long_bytecode_file_name.bc
  28. ; Test that the 'o' option is working by extracting a file, putting it in o
  29. ; new archive and checking that date.
  30. ; RUN: rm -f very_long_bytecode_file_name.bc
  31. ; RUN: llvm-ar xo %p/Inputs/GNU.a very_long_bytecode_file_name.bc
  32. ; RUN: rm -f %t.a
  33. ; RUN: llvm-ar rcU %t.a very_long_bytecode_file_name.bc
  34. ; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s
  35. CHECK: 1465 2004-11-19 03:01:31.000000000 very_long_bytecode_file_name.bc
  36. RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s
  37. NOTFOUND: foo.o was not found
  38. RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT
  39. THINEXTRACT: extracting from a thin archive is not supported
  40. RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN
  41. EVENLEN: evenlen
  42. RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o | FileCheck %s --check-prefix=MISSING
  43. MISSING: {{N|n}}o such file or directory.