Change archive-update.test to create a new file on the fly.
[oota-llvm.git] / test / Object / archive-update.test
1 Test the 'u' option of llvm-ar
2
3 REQUIRES: shell
4
5 RUN: cd %T
6 RUN: rm -f %t.a
7
8 Create a file named evenlen that is newer than the evenlen on the source dir.
9 RUN: mkdir -p %t.dir
10 RUN: echo newer > %t.dir/evenlen
11
12 Create an achive with the newest file
13 RUN: llvm-ar r %t.a %t.dir/evenlen
14 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
15
16 Check that without the 'u' option the member is replaced with an older file.
17 RUN: llvm-ar r %t.a %p/Inputs/evenlen
18 RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
19
20 Check that with the 'u' option the member is replaced with a newer file.
21 RUN: llvm-ar ru %t.a %t.dir/evenlen
22 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
23
24 Check that with the 'u' option the member is not replaced with an older file.
25 RUN: llvm-ar ru %t.a %p/Inputs/evenlen
26 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
27
28 NEWER: newer
29 OLDER: evenlen