Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 1 | Test the 'u' option of llvm-ar |
| 2 | |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 3 | RUN: cd %T |
| 4 | RUN: rm -f %t.a |
| 5 | |
Rafael Espindola | 04397c1 | 2013-07-12 21:17:17 +0000 | [diff] [blame] | 6 | Create a file named evenlen that is newer than the evenlen on the source dir. |
Chandler Carruth | ba310c4 | 2013-07-14 10:46:51 +0000 | [diff] [blame] | 7 | RUN: mkdir -p %t.older |
| 8 | RUN: echo older > %t.older/evenlen |
| 9 | |
| 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 |
| 13 | |
| 14 | RUN: mkdir -p %t.newer |
| 15 | RUN: echo newer > %t.newer/evenlen |
| 16 | RUN: touch %t.newer/evenlen |
Rafael Espindola | 04397c1 | 2013-07-12 21:17:17 +0000 | [diff] [blame] | 17 | |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 18 | Create an achive with the newest file |
Rafael Espindola | 6a8e86f | 2015-07-13 20:38:09 +0000 | [diff] [blame^] | 19 | RUN: llvm-ar rU %t.a %t.newer/evenlen |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 20 | RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s |
| 21 | |
| 22 | Check that without the 'u' option the member is replaced with an older file. |
Rafael Espindola | 6a8e86f | 2015-07-13 20:38:09 +0000 | [diff] [blame^] | 23 | RUN: llvm-ar rU %t.a %t.older/evenlen |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 24 | RUN: llvm-ar p %t.a | FileCheck --check-prefix=OLDER %s |
| 25 | |
| 26 | Check that with the 'u' option the member is replaced with a newer file. |
Rafael Espindola | 6a8e86f | 2015-07-13 20:38:09 +0000 | [diff] [blame^] | 27 | RUN: llvm-ar ruU %t.a %t.newer/evenlen |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 28 | RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s |
| 29 | |
| 30 | Check that with the 'u' option the member is not replaced with an older file. |
Rafael Espindola | 6a8e86f | 2015-07-13 20:38:09 +0000 | [diff] [blame^] | 31 | RUN: llvm-ar ruU %t.a %t.older/evenlen |
Rafael Espindola | 9cef215 | 2013-07-12 19:34:24 +0000 | [diff] [blame] | 32 | RUN: llvm-ar p %t.a | FileCheck --check-prefix=NEWER %s |
| 33 | |
| 34 | NEWER: newer |
Chandler Carruth | ba310c4 | 2013-07-14 10:46:51 +0000 | [diff] [blame] | 35 | OLDER: older |