[PATCH] D53064: [llvm-nm] Include the text "@FILE" in the output of --help

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 10 13:42:13 PDT 2018


mstorsjo updated this revision to Diff 169082.
mstorsjo added a comment.

Added a testcase that actually uses a response file. Will commit later with @rnk's approval unless there's further comments.


https://reviews.llvm.org/D53064

Files:
  test/tools/llvm-nm/X86/response-file.test
  test/tools/llvm-nm/libtool-response-file.test
  tools/llvm-nm/llvm-nm.cpp


Index: tools/llvm-nm/llvm-nm.cpp
===================================================================
--- tools/llvm-nm/llvm-nm.cpp
+++ tools/llvm-nm/llvm-nm.cpp
@@ -183,6 +183,8 @@
 cl::opt<bool> NoLLVMBitcode("no-llvm-bc",
                             cl::desc("Disable LLVM bitcode reader"));
 
+cl::extrahelp HelpResponse("\nPass @FILE as argument to read options from FILE.\n");
+
 bool PrintAddress = true;
 
 bool MultipleFiles = false;
Index: test/tools/llvm-nm/libtool-response-file.test
===================================================================
--- /dev/null
+++ test/tools/llvm-nm/libtool-response-file.test
@@ -0,0 +1,4 @@
+RUN: llvm-nm --help | FileCheck %s
+Check that the output of llvm-nm --help contains the literal text @FILE; this
+indicates to libtool that llvm-nm does support response files.
+CHECK: @FILE
Index: test/tools/llvm-nm/X86/response-file.test
===================================================================
--- /dev/null
+++ test/tools/llvm-nm/X86/response-file.test
@@ -0,0 +1,5 @@
+# RUN: echo "-P %p/Inputs/hello.obj.elf-x86_64" > %t-response
+# RUN: llvm-nm @%t-response | FileCheck %s
+
+CHECK: main T 0 0
+CHECK: puts U 0 0


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53064.169082.patch
Type: text/x-patch
Size: 1177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181010/953ca0ba/attachment.bin>


More information about the llvm-commits mailing list