brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.8 KiB · 2ed7b76 Raw
109 lines · plain
1# Note: many of these tests depend on relative paths, so we have to cd to a2# test directory first.3RUN: mkdir -p %t && cd %t4RUN: rm -rf a b && mkdir a b5RUN: echo hello-a      > a/foo.txt6RUN: echo hello-b      > b/foo.txt7RUN: echo hello-parent > foo.txt8 9# Verify that P is accepted.10RUN: rm -f noop.a && llvm-ar rcP noop.a foo.txt11RUN: llvm-ar p noop.a | FileCheck %s --check-prefix=ACCEPT12 13ACCEPT: hello-parent14 15# Regular (non-thin) archives cannot be created with full path names as16# members, but P can still affect how lookup works (assuming we're reading an17# archive not created by GNU ar or llvm-ar).18# Looking up a/foo.txt in a regular archive will fail with P because it is19# added to the archive as foo.txt.20RUN: rm -f display.a21RUN: llvm-ar rcS display.a a/foo.txt foo.txt b/foo.txt22RUN: llvm-ar t display.a a/foo.txt | FileCheck %s --check-prefix=DISPLAY-FOUND --match-full-lines23RUN: not llvm-ar tP display.a a/foo.txt 2>&1 | FileCheck %s --check-prefix=DISPLAY-NOT-FOUND24 25DISPLAY-FOUND: foo.txt26DISPLAY-NOT-FOUND: 'a/foo.txt' was not found27 28# Deleting will fail with P because the members exist as foo.txt, not a/foo.txt.29RUN: rm -f del1.a30RUN: llvm-ar rcS del1.a foo.txt31RUN: llvm-ar dP del1.a a/foo.txt32RUN: llvm-ar t del1.a a/foo.txt | FileCheck %s --check-prefix=DISPLAY-FOUND --match-full-lines33RUN: llvm-ar d del1.a a/foo.txt34RUN: not llvm-ar t del1.a a/foo.txt 2>&1 | FileCheck %s --check-prefix=DISPLAY-NOT-FOUND35 36# Run several checks that P is implied when using thin archives. None of these37# checks explicitly use P.38 39# Creating an archive in one step.40RUN: rm -f add.a41RUN: llvm-ar rcST add.a a/foo.txt foo.txt b/foo.txt42RUN: llvm-ar t add.a | FileCheck %s --check-prefix=ADD --match-full-lines43 44ADD:      a/foo.txt45ADD-NEXT: foo.txt46ADD-NEXT: b/foo.txt47 48# Create an archive incrementally.49RUN: rm -f add-inc.a50RUN: llvm-ar rcST add-inc.a a/foo.txt51RUN: llvm-ar rcST add-inc.a foo.txt52RUN: llvm-ar rcST add-inc.a b/foo.txt53RUN: llvm-ar t add-inc.a | FileCheck %s --check-prefix=ADD-INC --match-full-lines54 55ADD-INC:      a/foo.txt56ADD-INC-NEXT: foo.txt57ADD-INC-NEXT: b/foo.txt58 59# Nesting a thin archive with a name conflict.60RUN: rm -f a/nested.a b/nested.a nested.a61RUN: llvm-ar rcST a/nested.a a/foo.txt62RUN: llvm-ar rcST b/nested.a b/foo.txt63RUN: llvm-ar rcST nested.a a/nested.a foo.txt b/nested.a64RUN: llvm-ar t nested.a | FileCheck %s --check-prefix=NESTED --match-full-lines65 66NESTED:      a/foo.txt67NESTED-NEXT: foo.txt68NESTED-NEXT: b/foo.txt69 70# Printing members.71RUN: rm -f add.a72RUN: llvm-ar rcST add.a a/foo.txt foo.txt b/foo.txt73RUN: llvm-ar p add.a foo.txt | FileCheck %s --check-prefix=PRINT-PARENT --match-full-lines74RUN: llvm-ar p add.a a/foo.txt | FileCheck %s --check-prefix=PRINT-A --match-full-lines75RUN: llvm-ar p add.a b/foo.txt | FileCheck %s --check-prefix=PRINT-B --match-full-lines76PRINT-PARENT: hello-parent77PRINT-A:      hello-a78PRINT-B:      hello-b79 80# Listing members.81RUN: rm -f add.a82RUN: llvm-ar rcST add.a a/foo.txt foo.txt b/foo.txt83RUN: llvm-ar t add.a foo.txt | FileCheck %s --check-prefix=LIST-PARENT --match-full-lines84RUN: llvm-ar t add.a a/foo.txt | FileCheck %s --check-prefix=LIST-A --match-full-lines85RUN: llvm-ar t add.a b/foo.txt | FileCheck %s --check-prefix=LIST-B --match-full-lines86LIST-PARENT:     foo.txt87LIST-PARENT-NOT: a/foo.txt88LIST-PARENT-NOT: b/foo.txt89LIST-A:          a/foo.txt90LIST-B:          b/foo.txt91 92# Deleting members.93RUN: rm -f del1.a94RUN: llvm-ar rcST del1.a a/foo.txt foo.txt b/foo.txt95RUN: llvm-ar d del1.a foo.txt96RUN: llvm-ar t del1.a | FileCheck %s --check-prefix=DEL-1 --match-full-lines97 98DEL-1-NOT:  foo.txt99DEL-1:      a/foo.txt100DEL-1-NEXT: b/foo.txt101 102RUN: rm -f del2.a103RUN: llvm-ar rcST del2.a a/foo.txt foo.txt b/foo.txt104RUN: llvm-ar d del2.a a/foo.txt105RUN: llvm-ar t del2.a | FileCheck %s --check-prefix=DEL-2 --match-full-lines106DEL-2-NOT:  a/foo.txt107DEL-2:      foo.txt108DEL-2-NEXT: b/foo.txt109