Home | History | Annotate | Download | only in Object
      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.older
     10 RUN: echo older > %t.older/evenlen
     11 
     12 Either the shell supports the 'touch' command with a flag to manually set the
     13 mtime or we sleep for over a second so that the mtime is definitely observable.
     14 RUN: touch -m -t 200001010000 %t.older/evenlen || sleep 1.1
     15 
     16 RUN: mkdir -p %t.newer
     17 RUN: echo newer > %t.newer/evenlen
     18 RUN: touch %t.newer/evenlen
     19 
     20 Create an achive with the newest file
     21 RUN: llvm-ar r %t.a %t.newer/evenlen
     22 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
     23 
     24 Check that without the 'u' option the member is replaced with an older file.
     25 RUN: llvm-ar r %t.a %t.older/evenlen
     26 RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s
     27 
     28 Check that with the 'u' option the member is replaced with a newer file.
     29 RUN: llvm-ar ru %t.a %t.newer/evenlen
     30 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
     31 
     32 Check that with the 'u' option the member is not replaced with an older file.
     33 RUN: llvm-ar ru %t.a %t.older/evenlen
     34 RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s
     35 
     36 NEWER: newer
     37 OLDER: older
     38