This fixes the way archive members are displayed when the linker is used with a
flag to show all the files that it processes.
When an archive file member is read, we need to show the archive filename and
the member.
llvm-svn: 220144
return ec;
llvm::MemoryBufferRef mb = mbOrErr.get();
if (_logLoading)
- llvm::outs() << mb.getBufferIdentifier() << "\n";
+ llvm::outs() << _archive->getFileName() << "(" << mb.getBufferIdentifier()
+ << ")"
+ << "\n";
std::unique_ptr<MemoryBuffer> buf(MemoryBuffer::getMemBuffer(
mb.getBuffer(), mb.getBufferIdentifier(), false));
--- /dev/null
+# Tests functionality of -t
+#
+# Tests generated using the source files below
+# main file
+# int main()
+# {
+# fn();
+# return 0;
+# }
+#
+# archive file
+# int fn()
+# {
+# return 0;
+# }
+#
+# int fn1()
+# {
+# return 0;
+# }
+# gcc -c main.c fn.c fn1.c
+
+RUN: lld -flavor gnu -target x86_64-linux \
+RUN: %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a -t --noinhibit-exec 2>&1 | \
+RUN: FileCheck -check-prefix INPUTFILES %s
+
+#INPUTFILES: mainobj.x86_64
+#INPUTFILES: libfnarchive.a(fn.o)