99 lines · plain
1## Test Print output2 3# RUN: rm -rf %t && mkdir -p %t4# RUN: echo file1 > %t/1.txt5# RUN: echo file2 > %t/2.txt6# RUN: echo file3 > %t/3.txt7 8# RUN: llvm-ar -rc --format=gnu %t/archive.a %t/1.txt %t/2.txt %t/3.txt9 10## Print empty archive:11# RUN: llvm-ar --format=gnu cr %t/empty.a12# RUN: llvm-ar p %t/empty.a 2>&1 | count 013# RUN: llvm-ar pv %t/empty.a 2>&1 | count 014 15## Print without member:16# RUN: llvm-ar p %t/archive.a \17# RUN: | FileCheck %s --check-prefix=WITHOUT --match-full-lines --implicit-check-not {{.}}18 19# WITHOUT: file120# WITHOUT-NEXT: file221# WITHOUT-NEXT: file322 23# RUN: llvm-ar pv %t/archive.a \24# RUN: | FileCheck %s --check-prefix=WITHOUT-VERBOSE --match-full-lines --implicit-check-not {{.}}25 26# WITHOUT-VERBOSE: Printing 1.txt27# WITHOUT-VERBOSE-NEXT: file128# WITHOUT-VERBOSE-NEXT: Printing 2.txt29# WITHOUT-VERBOSE-NEXT: file230# WITHOUT-VERBOSE-NEXT: Printing 3.txt31# WITHOUT-VERBOSE-NEXT: file332 33## Print single member:34# RUN: llvm-ar p %t/archive.a %t/2.txt \35# RUN: | FileCheck %s --check-prefix=SINGLE --match-full-lines --implicit-check-not {{.}}36 37# SINGLE: file238 39# RUN: llvm-ar pv %t/archive.a %t/2.txt \40# RUN: | FileCheck %s --check-prefix=SINGLE-VERBOSE --match-full-lines --implicit-check-not {{.}}41 42# SINGLE-VERBOSE: Printing 2.txt43# SINGLE-VERBOSE-NEXT: file244 45## Print multiple members:46# RUN: llvm-ar p %t/archive.a %t/2.txt %t/1.txt \47# RUN: | FileCheck %s --check-prefix=MULTIPLE --match-full-lines --implicit-check-not {{.}}48 49# MULTIPLE: file150# MULTIPLE-NEXT: file251 52# RUN: llvm-ar pv %t/archive.a %t/2.txt %t/1.txt \53# RUN: | FileCheck %s --check-prefix=MULTIPLE-VERBOSE --match-full-lines --implicit-check-not {{.}}54 55# MULTIPLE-VERBOSE: Printing 1.txt56# MULTIPLE-VERBOSE-NEXT: file157# MULTIPLE-VERBOSE-NEXT: Printing 2.txt58# MULTIPLE-VERBOSE-NEXT: file259 60## Print same member:61# RUN: not llvm-ar p %t/archive.a %t/2.txt %t/2.txt 2>&1 \62# RUN: | FileCheck %s --check-prefix=SAME -DFILE=%t/2.txt63 64# SAME-DAG: file265# SAME-DAG: error: '[[FILE]]' was not found66 67## Print same member when containing multiple members with shared name:68# llvm-ar -q %t/archive.a %t/2.txt69# RUN: not llvm-ar p %t/archive.a %t/2.txt %t/2.txt 2>&1 \70# RUN: | FileCheck %s --check-prefix=SAME -DFILE=%t/2.txt71 72## No archive:73# RUN: not llvm-ar p 2>&1 \74# RUN: | FileCheck %s --check-prefix=NO-ARCHIVE75# 76# NO-ARCHIVE: error: an archive name must be specified77 78## Archive does not exist:79# RUN: not llvm-ar p %t/missing.a 2>&1 \80# RUN: | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=MISSING-ARCHIVE -DARCHIVE=%t/missing.a81 82# MISSING-ARCHIVE: error: unable to load '[[ARCHIVE]]': [[MSG]]83 84## Member does not exist:85# RUN: not llvm-ar p %t/archive.a %t-missing.txt 2>&1 \86# RUN: | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t-missing.txt87 88# MISSING-FILE: error: '[[FILE]]' was not found89 90## Print empty thin archive:91# RUN: llvm-ar Trc %t/thin-archive-empty.a92# RUN: llvm-ar p %t/thin-archive-empty.a 2>&1 | count 093# RUN: llvm-ar pv %t/thin-archive-empty.a 2>&1 | count 094 95## Print thin archive:96# RUN: llvm-ar Trc %t/thin-archive.a %t/1.txt %t/2.txt %t/3.txt97# RUN: llvm-ar p %t/archive.a %t/2.txt \98# RUN: | FileCheck %s --check-prefix=SINGLE --match-full-lines --implicit-check-not {{.}}99