Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 1 | ; This test just makes sure that llvm-ar can extract bytecode members |
| 2 | ; from various style archives. |
| 3 | |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 4 | ; RUN: cd %T |
| 5 | |
| 6 | ; RUN: rm -f very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 7 | ; RUN: llvm-ar p %p/Inputs/GNU.a very_long_bytecode_file_name.bc | \ |
| 8 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc - |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 9 | ; RUN: llvm-ar x %p/Inputs/GNU.a very_long_bytecode_file_name.bc |
| 10 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \ |
| 11 | ; RUN: very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 12 | |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 13 | ; RUN: rm -f very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 14 | ; RUN: llvm-ar p %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc | \ |
| 15 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc - |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 16 | ; RUN: llvm-ar x %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc |
| 17 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \ |
| 18 | ; RUN: very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 19 | |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 20 | ; RUN: rm -f very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 21 | ; RUN: llvm-ar p %p/Inputs/SVR4.a very_long_bytecode_file_name.bc | \ |
| 22 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc - |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 23 | ; RUN: llvm-ar x %p/Inputs/SVR4.a very_long_bytecode_file_name.bc |
| 24 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \ |
| 25 | ; RUN: very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 26 | |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 27 | ; RUN: rm -f very_long_bytecode_file_name.bc |
Rafael Espindola | 3b5475c | 2013-07-10 21:47:16 +0000 | [diff] [blame] | 28 | ; RUN: llvm-ar p %p/Inputs/xpg4.a very_long_bytecode_file_name.bc |\ |
| 29 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc - |
Rafael Espindola | 54dbca5 | 2013-07-11 13:13:09 +0000 | [diff] [blame] | 30 | ; RUN: llvm-ar x %p/Inputs/xpg4.a very_long_bytecode_file_name.bc |
| 31 | ; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \ |
| 32 | ; RUN: very_long_bytecode_file_name.bc |
Rafael Espindola | 3e7249f | 2013-07-12 18:51:25 +0000 | [diff] [blame] | 33 | |
| 34 | |
| 35 | ; Test that the 'o' option is working by extracting a file, putting it in o |
| 36 | ; new archive and checking that date. |
| 37 | ; RUN: rm -f very_long_bytecode_file_name.bc |
| 38 | ; RUN: llvm-ar xo %p/Inputs/GNU.a very_long_bytecode_file_name.bc |
Bill Wendling | 2f98bac | 2014-01-16 07:08:22 +0000 | [diff] [blame] | 39 | ; RUN: rm -f %t.a |
Rafael Espindola | 6a8e86f | 2015-07-13 20:38:09 +0000 | [diff] [blame] | 40 | ; RUN: llvm-ar rcU %t.a very_long_bytecode_file_name.bc |
Rafael Espindola | 3e7249f | 2013-07-12 18:51:25 +0000 | [diff] [blame] | 41 | ; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s |
| 42 | |
Chandler Carruth | 0ef74f5 | 2014-04-28 01:24:32 +0000 | [diff] [blame] | 43 | CHECK: 1465 2004-11-19 03:01:31.000000000 very_long_bytecode_file_name.bc |
Rafael Espindola | c3eec45 | 2015-07-14 16:02:40 +0000 | [diff] [blame] | 44 | |
| 45 | |
| 46 | RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s |
| 47 | NOTFOUND: foo.o was not found |
Rafael Espindola | e549b8c | 2015-07-14 16:55:13 +0000 | [diff] [blame] | 48 | |
| 49 | RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT |
| 50 | THINEXTRACT: extracting from a thin archive is not supported |
Rafael Espindola | 4b83cb5 | 2015-07-14 22:18:43 +0000 | [diff] [blame] | 51 | |
| 52 | RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN |
| 53 | EVENLEN: evenlen |
| 54 | |
| 55 | RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o | FileCheck %s --check-prefix=MISSING |
Rafael Espindola | 142fc2d | 2015-07-14 22:42:21 +0000 | [diff] [blame] | 56 | MISSING: {{N|n}}o such file or directory. |