archive-update.test 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Test the 'u' option of llvm-ar
  2. RUN: cd %T
  3. RUN: rm -f %t.a
  4. Create a file named evenlen that is newer than the evenlen on the source dir.
  5. RUN: mkdir -p %t.older
  6. RUN: echo older > %t.older/evenlen
  7. Either the shell supports the 'touch' command with a flag to manually set the
  8. mtime or we sleep for over two seconds so that the mtime is definitely
  9. observable.
  10. RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 2.1
  11. RUN: mkdir -p %t.newer
  12. RUN: echo newer > %t.newer/evenlen
  13. RUN: touch %t.newer/evenlen
  14. Create an achive with the newest file
  15. RUN: llvm-ar rU %t.a %t.newer/evenlen
  16. RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
  17. Check that without the 'u' option the member is replaced with an older file.
  18. RUN: llvm-ar rU %t.a %t.older/evenlen
  19. RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
  20. Check that with the 'u' option the member is replaced with a newer file.
  21. RUN: llvm-ar ruU %t.a %t.newer/evenlen
  22. RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
  23. Check that with the 'u' option the member is not replaced with an older file.
  24. RUN: llvm-ar ruU %t.a %t.older/evenlen
  25. RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
  26. NEWER: newer
  27. OLDER: older