From 5cb34077e879c03d460dedad7aaa421bd2bd08a3 Mon Sep 17 00:00:00 2001 From: David Callahan Date: Wed, 30 Nov 2016 22:32:58 +0000 Subject: Only computeRelativePath() on new members Summary: When using thin archives, and processing the same archive multiple times, we were mangling existing entries. The root cause is that we were calling computeRelativePath() more than once. Here, we only call it when adding new members to an archive. Note that D27218 changes the way thin archives are printed, and will break the new unit test included here. Depending on which one lands first, the other will need to be slightly modified. Reviewers: rafael, davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27217 llvm-svn: 288280 --- llvm/test/Object/archive-thin-create.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 llvm/test/Object/archive-thin-create.test (limited to 'llvm/test/Object/archive-thin-create.test') diff --git a/llvm/test/Object/archive-thin-create.test b/llvm/test/Object/archive-thin-create.test new file mode 100644 index 00000000000..d9ee518bc2d --- /dev/null +++ b/llvm/test/Object/archive-thin-create.test @@ -0,0 +1,14 @@ +RUN: mkdir -p %t +RUN: cd %t +RUN: mkdir -p foo +RUN: touch foo/test1.o +RUN: touch foo/test2.o +RUN: llvm-ar qcT foo/libtest.a foo/test1.o +RUN: llvm-ar qcT foo/libtest.a foo/test1.o +RUN: llvm-ar qcT foo/libtest.a foo/test2.o +RUN: llvm-ar t foo/libtest.a | FileCheck %s + +CHECK: test1.o +CHECK: test1.o +CHECK: test2.o + -- cgit v1.2.3