blob: 147db90ba951b4b91c92c3f16f0a7e1fe16bc863 [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
Rafael Espindola4ae78432015-07-14 16:34:23 +000011mtime or we sleep for over two seconds so that the mtime is definitely
12observable.
13RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 2.1
Chandler Carruthba310c42013-07-14 10:46:51 +000014
15RUN: mkdir -p %t.newer
16RUN: echo newer > %t.newer/evenlen
17RUN: touch %t.newer/evenlen
Rafael Espindola04397c12013-07-12 21:17:17 +000018
Rafael Espindola9cef2152013-07-12 19:34:24 +000019Create an achive with the newest file
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000020RUN: llvm-ar rU %t.a %t.newer/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000021RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
22
23Check that without the 'u' option the member is replaced with an older file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000024RUN: llvm-ar rU %t.a %t.older/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000025RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
26
27Check that with the 'u' option the member is replaced with a newer file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000028RUN: llvm-ar ruU %t.a %t.newer/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000029RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
30
31Check that with the 'u' option the member is not replaced with an older file.
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000032RUN: llvm-ar ruU %t.a %t.older/evenlen
Rafael Espindola9cef2152013-07-12 19:34:24 +000033RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
34
35NEWER: newer
Chandler Carruthba310c42013-07-14 10:46:51 +000036OLDER: older