llvm.org GIT mirror llvm / 360b8e5
[llvm-ar] Remove leading slash when printing thin archive members Reviewers: ruiu Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D57845 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353347 91177308-0d34-0410-b5e6-96231b3b80d8 Jordan Rupprecht 6 months ago
2 changed file(s) with 13 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
0 RUN: mkdir -p %t/foo
1 RUN: touch %t/foo/a.txt
2 RUN: rm -f %t/foo/archive.a
3
4 RUN: cd %t && llvm-ar rcST foo/archive.a foo/a.txt
5 RUN: cd %t && llvm-ar t foo/archive.a | FileCheck %s --match-full-lines --check-prefix=PARENT-DIR
6 RUN: cd %t/foo && llvm-ar t archive.a | FileCheck %s --match-full-lines --check-prefix=CHILD-DIR
7
8 PARENT-DIR: foo/a.txt
9 CHILD-DIR: a.txt
428428 }
429429
430430 if (C.getParent()->isThin()) {
431 outs() << sys::path::parent_path(ArchiveName);
432 outs() << '/';
431 StringRef ParentDir = sys::path::parent_path(ArchiveName);
432 if (!ParentDir.empty())
433 outs() << ParentDir << '/';
433434 }
434435 outs() << Name << "\n";
435436 }