63 lines · plain
1; This test just makes sure that llvm-ar can extract bytecode members2; from various style archives.3 4; UNSUPPORTED: target={{.*}}-zos{{.*}}5; RUN: rm -rf %t && mkdir -p %t && cd %t6 7; RUN: rm -f very_long_bytecode_file_name.bc8; RUN: llvm-ar p %p/Inputs/GNU.a very_long_bytecode_file_name.bc | \9; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -10; RUN: llvm-ar x %p/Inputs/GNU.a very_long_bytecode_file_name.bc11; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \12; RUN: very_long_bytecode_file_name.bc13 14; RUN: rm -f very_long_bytecode_file_name.bc15; RUN: llvm-ar p %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc | \16; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -17; RUN: llvm-ar x %p/Inputs/MacOSX.a very_long_bytecode_file_name.bc18; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \19; RUN: very_long_bytecode_file_name.bc20 21; RUN: rm -f very_long_bytecode_file_name.bc22; RUN: llvm-ar p %p/Inputs/SVR4.a very_long_bytecode_file_name.bc | \23; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -24; RUN: llvm-ar x %p/Inputs/SVR4.a very_long_bytecode_file_name.bc25; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \26; RUN: very_long_bytecode_file_name.bc27 28; RUN: rm -f very_long_bytecode_file_name.bc29; RUN: llvm-ar p %p/Inputs/xpg4.a very_long_bytecode_file_name.bc |\30; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc -31; RUN: llvm-ar x %p/Inputs/xpg4.a very_long_bytecode_file_name.bc32; RUN: cmp -s %p/Inputs/very_long_bytecode_file_name.bc \33; RUN: very_long_bytecode_file_name.bc34 35 36; Test that the 'o' option is working by extracting a file, putting it in o37; new archive and checking that date.38; RUN: rm -f very_long_bytecode_file_name.bc39; RUN: llvm-ar xo %p/Inputs/GNU.a very_long_bytecode_file_name.bc40; RUN: rm -f %t.a41; RUN: llvm-ar --format=gnu rcU %t.a very_long_bytecode_file_name.bc42; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s -check-prefix CHECK-GNU43 44CHECK-GNU: 1465 Nov 19 03:01 2004 very_long_bytecode_file_name.bc45 46; RUN: rm -f %t.a47; RUN: llvm-ar --format=darwin rcU %t.a very_long_bytecode_file_name.bc48; RUN: env TZ=GMT llvm-ar tv %t.a | FileCheck %s -check-prefix CHECK-DARWIN49 50CHECK-DARWIN: 1472 Nov 19 03:01 2004 very_long_bytecode_file_name.bc51 52RUN: not llvm-ar x %p/Inputs/GNU.a foo.o 2>&1 | FileCheck --check-prefix=NOTFOUND %s53NOTFOUND: error: 'foo.o' was not found54 55RUN: not llvm-ar x %p/Inputs/thin.a foo.o 2>&1 | FileCheck %s --check-prefix=THINEXTRACT56THINEXTRACT: extracting from a thin archive is not supported57 58RUN: llvm-ar p %p/Inputs/thin.a evenlen | FileCheck %s --check-prefix=EVENLEN59EVENLEN: evenlen60 61RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o 2>&1 | FileCheck %s --DMSG=%errc_ENOENT --check-prefix=MISSING62MISSING: error: [[MSG]]63