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