1Test the 'u' option of llvm-ar 2 3RUN: cd %T 4RUN: rm -f %t.a 5 6Create a file named evenlen that is newer than the evenlen on the source dir. 7RUN: mkdir -p %t.older 8RUN: echo older > %t.older/evenlen 9 10RUN: mkdir -p %t.newer 11 12Either the shell supports the 'touch' command with a flag to manually set the 13mtime or we sleep for over two seconds so that the mtime is definitely 14observable. 15RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 2.1 16 17RUN: echo newer > %t.newer/evenlen 18RUN: touch %t.newer/evenlen 19 20Create an achive with the newest file 21RUN: llvm-ar rU %t.a %t.newer/evenlen 22RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s 23 24Check that without the 'u' option the member is replaced with an older file. 25RUN: llvm-ar rU %t.a %t.older/evenlen 26RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s 27 28Check that with the 'u' option the member is replaced with a newer file. 29RUN: llvm-ar ruU %t.a %t.newer/evenlen 30RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s 31 32Check that with the 'u' option the member is not replaced with an older file. 33RUN: llvm-ar ruU %t.a %t.older/evenlen 34RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s 35 36NEWER: newer 37OLDER: older 38 39RUN: rm -f %t.a 40RUN: echo foo > foo 41RUN: echo bar > bar 42RUN: llvm-ar --format=gnu rcT %t.a foo 43RUN: llvm-ar --format=gnu rcT %t.a bar 44RUN: llvm-ar t %t.a | FileCheck --check-prefix=BOTH-FILES %s 45BOTH-FILES: foo 46BOTH-FILES: bar 47 48RUN: rm -f %t.a 49RUN: llvm-ar --format=gnu rc %t.a foo 50RUN: not llvm-ar --format=gnu rcT %t.a bar 2>&1 | FileCheck --check-prefix=ERROR %s 51ERROR: Cannot convert a regular archive to a thin one. 52