blob: 450b5cd4ed8e23d2bc4e05e38721d730a9b71606 [file] [log] [blame]
Rafael Espindola9cef2152013-07-12 19:34:24 +00001Test the 'u' option of llvm-ar
2
Rafael Espindola9cef2152013-07-12 19:34:24 +00003RUN: cd %T
4RUN: rm -f %t.a
5
Rafael Espindola04397c12013-07-12 21:17:17 +00006Create a file named evenlen that is newer than the evenlen on the source dir.
Chandler Carruthba310c42013-07-14 10:46:51 +00007RUN: mkdir -p %t.older
8RUN: echo older > %t.older/evenlen
9
10Either the shell supports the 'touch' command with a flag to manually set the
11mtime or we sleep for over a second so that the mtime is definitely observable.
12RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 1.1
13
14RUN: mkdir -p %t.newer
15RUN: echo newer > %t.newer/evenlen
16RUN: touch %t.newer/evenlen
Rafael Espindola04397c12013-07-12 21:17:17 +000017
Rafael Espindola9cef2152013-07-12 19:34:24 +000018Create an achive with the newest file
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000019RUN: llvm-ar rU %t.a %t.newer/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000020RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
21
22Check that without the 'u' option the member is replaced with an older file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000023RUN: llvm-ar rU %t.a %t.older/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000024RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
25
26Check that with the 'u' option the member is replaced with a newer file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000027RUN: llvm-ar ruU %t.a %t.newer/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000028RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
29
30Check that with the 'u' option the member is not replaced with an older file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000031RUN: llvm-ar ruU %t.a %t.older/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000032RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
33
34NEWER: newer
Chandler Carruthba310c42013-07-14 10:46:51 +000035OLDER: older