llvm-project/llvm/test/tools/llvm-ar/thin-archive-relative-path.test
gbreynoo dcbf61b352 [llvm-ar] Fix when llvm-ar fails to replace existing members when updating a thin archive
As seen in https://github.com/llvm/llvm-project/issues/55023 when a thin
archive is updated when not in the CWD, replacement does not work as
expected. This change fixes the relative file path comparison so the
correct files are updated.

Differential Revision: https://reviews.llvm.org/D138218
2022-11-18 14:37:56 +00:00

20 lines
675 B
Plaintext

RUN: rm -rf %t && mkdir -p %t/foo %t/bar
RUN: yaml2obj %S/Inputs/elf.yaml -o %t/foo/elf.o
RUN: cp %t/foo/elf.o %t/bar/elf.o
RUN: cd %t
Test a case in which CWD does not contain the archive, ensure replacement behaves as expected
RUN: llvm-ar cr --thin foo/lib.a foo/elf.o
RUN: llvm-ar t foo/lib.a | FileCheck %s --check-prefix=FOO --implicit-check-not {{.}}
RUN: llvm-ar cr --thin foo/lib.a bar/elf.o
RUN: llvm-ar t foo/lib.a | FileCheck %s --check-prefixes=FOO,BAR --implicit-check-not {{.}}
RUN: llvm-ar cr --thin foo/lib.a foo/elf.o
RUN: llvm-ar t foo/lib.a | FileCheck %s --check-prefixes=FOO,BAR --implicit-check-not {{.}}
FOO: foo/elf.o
BAR: foo/../bar/elf.o