blob: 50372d530d88c212c005543520b0035fcac6414d [file] [log] [blame]
Rafael Espindola3b5475c2013-07-10 21:47:16 +00001; This test just makes sure that llvm-ar can extract bytecode members
2; from various style archives.
3
Rafael Espindola54dbca52013-07-11 13:13:09 +00004; RUN: cd %T
5
6; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola3b5475c2013-07-10 21:47:16 +00007; 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 Espindola54dbca52013-07-11 13:13:09 +00009; 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 Espindola3b5475c2013-07-10 21:47:16 +000012
Rafael Espindola54dbca52013-07-11 13:13:09 +000013; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola3b5475c2013-07-10 21:47:16 +000014; 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 Espindola54dbca52013-07-11 13:13:09 +000016; 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 Espindola3b5475c2013-07-10 21:47:16 +000019
Rafael Espindola54dbca52013-07-11 13:13:09 +000020; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola3b5475c2013-07-10 21:47:16 +000021; 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 Espindola54dbca52013-07-11 13:13:09 +000023; 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 Espindola3b5475c2013-07-10 21:47:16 +000026
Rafael Espindola54dbca52013-07-11 13:13:09 +000027; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola3b5475c2013-07-10 21:47:16 +000028; 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 Espindola54dbca52013-07-11 13:13:09 +000030; 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 Espindola3e7249f2013-07-12 18:51:25 +000033
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 Wendling2f98bac2014-01-16 07:08:22 +000039; RUN: rm -f %t.a
Rafael Espindola6a8e86f2015-07-13 20:38:09 +000040; RUN: llvm-ar rcU %t.a very_long_bytecode_file_name.bc
Rafael Espindola3e7249f2013-07-12 18:51:25 +000041; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s
42
Chandler Carruth0ef74f52014-04-28 01:24:32 +000043CHECK: 1465 2004-11-19 03:01:31.000000000 very_long_bytecode_file_name.bc
Rafael Espindolac3eec452015-07-14 16:02:40 +000044
45
46RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s
47NOTFOUND: foo.o was not found
Rafael Espindolae549b8c2015-07-14 16:55:13 +000048
49RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT
50THINEXTRACT: extracting from a thin archive is not supported
Rafael Espindola4b83cb52015-07-14 22:18:43 +000051
52RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN
53EVENLEN: evenlen
54
55RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o | FileCheck %s --check-prefix=MISSING
Rafael Espindola142fc2d2015-07-14 22:42:21 +000056MISSING: {{N|n}}o such file or directory.