1 Test the 'u' option of llvm-ar
6 Create a file named evenlen that is newer than the evenlen on the source dir.
8 RUN: echo older > %t.older/evenlen
10 Either the shell supports the 'touch' command with a flag to manually set the
11 mtime or we sleep for over a second so that the mtime is definitely observable.
12 RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 1.1
14 RUN: mkdir -p %t.newer
15 RUN: echo newer > %t.newer/evenlen
16 RUN: touch %t.newer/evenlen
18 Create an achive with the newest file
19 RUN: llvm-ar r %t.a %t.newer/evenlen
20 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
22 Check that without the 'u' option the member is replaced with an older file.
23 RUN: llvm-ar r %t.a %t.older/evenlen
24 RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
26 Check that with the 'u' option the member is replaced with a newer file.
27 RUN: llvm-ar ru %t.a %t.newer/evenlen
28 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
30 Check that with the 'u' option the member is not replaced with an older file.
31 RUN: llvm-ar ru %t.a %t.older/evenlen
32 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s