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
--- /dev/null
+RUN: mkdir -p %t/foo
+RUN: touch %t/foo/a.txt
+RUN: rm -f %t/foo/archive.a
+
+RUN: cd %t && llvm-ar rcST foo/archive.a foo/a.txt
+RUN: cd %t && llvm-ar t foo/archive.a | FileCheck %s --match-full-lines --check-prefix=PARENT-DIR
+RUN: cd %t/foo && llvm-ar t archive.a | FileCheck %s --match-full-lines --check-prefix=CHILD-DIR
+
+PARENT-DIR: foo/a.txt
+CHILD-DIR: a.txt
}
if (C.getParent()->isThin()) {
- outs() << sys::path::parent_path(ArchiveName);
- outs() << '/';
+ StringRef ParentDir = sys::path::parent_path(ArchiveName);
+ if (!ParentDir.empty())
+ outs() << ParentDir << '/';
}
outs() << Name << "\n";
}