blob: 916ccc254323b78eaba6454349484475809b0447 [file] [log] [blame]
Rafael Espindola69119112013-07-10 21:47:16 +00001; This test just makes sure that llvm-ar can extract bytecode members
2; from various style archives.
3
Kuba Mracek6965d512017-08-20 18:18:44 +00004; RUN: rm -rf %t && mkdir -p %t && cd %t
Rafael Espindola86779ee2013-07-11 13:13:09 +00005
6; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola69119112013-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 Espindola86779ee2013-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 Espindola69119112013-07-10 21:47:16 +000012
Rafael Espindola86779ee2013-07-11 13:13:09 +000013; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola69119112013-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 Espindola86779ee2013-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 Espindola69119112013-07-10 21:47:16 +000019
Rafael Espindola86779ee2013-07-11 13:13:09 +000020; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola69119112013-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 Espindola86779ee2013-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 Espindola69119112013-07-10 21:47:16 +000026
Rafael Espindola86779ee2013-07-11 13:13:09 +000027; RUN: rm -f very_long_bytecode_file_name.bc
Rafael Espindola69119112013-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 Espindola86779ee2013-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 Espindola8f813252013-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 Wendlingf847b5b2014-01-16 07:08:22 +000039; RUN: rm -f %t.a
Saleem Abdulrasool4c5e9062017-02-09 20:06:30 +000040; RUN: llvm-ar -format gnu rcU %t.a very_long_bytecode_file_name.bc
41; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s -check-prefix CHECK-GNU
Rafael Espindola8f813252013-07-12 18:51:25 +000042
Jordan Rupprecht4f840f12018-10-05 23:25:39 +000043CHECK-GNU: 1465 Nov 19 03:01 2004 very_long_bytecode_file_name.bc
Rafael Espindola4daa23f2015-07-14 16:02:40 +000044
Saleem Abdulrasool4c5e9062017-02-09 20:06:30 +000045; RUN: rm -f %t.a
Rafael Espindola13f0c802017-02-21 20:40:54 +000046; RUN: llvm-ar -format darwin rcU %t.a very_long_bytecode_file_name.bc
47; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s -check-prefix CHECK-DARWIN
Saleem Abdulrasool4c5e9062017-02-09 20:06:30 +000048
Jordan Rupprecht4f840f12018-10-05 23:25:39 +000049CHECK-DARWIN: 1472 Nov 19 03:01 2004 very_long_bytecode_file_name.bc
Rafael Espindola4daa23f2015-07-14 16:02:40 +000050
51RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s
Jordan Rupprecht2e3d9f72019-01-15 22:03:08 +000052NOTFOUND: error: 'foo.o' was not found
Rafael Espindola6e9f4272015-07-14 16:55:13 +000053
54RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT
55THINEXTRACT: extracting from a thin archive is not supported
Rafael Espindola7a6e3432015-07-14 22:18:43 +000056
57RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN
58EVENLEN: evenlen
59
Davide Italiano6edf98c2017-04-05 14:52:17 +000060RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o 2>&1 | FileCheck %s --check-prefix=MISSING
Rafael Espindola0ab901a2015-07-14 22:42:21 +000061MISSING: {{N|n}}o such file or directory.