summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/utils/FileCheck
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
committerpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
commitbdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch)
treec50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/utils/FileCheck
parentPrint a 'p' flag for file descriptors that were opened after pledge(2). (diff)
downloadwireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz
wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/utils/FileCheck')
-rw-r--r--gnu/llvm/utils/FileCheck/CMakeLists.txt2
-rw-r--r--gnu/llvm/utils/FileCheck/FileCheck.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/gnu/llvm/utils/FileCheck/CMakeLists.txt b/gnu/llvm/utils/FileCheck/CMakeLists.txt
index 999320f78af..32e948a1a19 100644
--- a/gnu/llvm/utils/FileCheck/CMakeLists.txt
+++ b/gnu/llvm/utils/FileCheck/CMakeLists.txt
@@ -2,4 +2,4 @@ add_llvm_utility(FileCheck
FileCheck.cpp
)
-target_link_libraries(FileCheck LLVMSupport)
+target_link_libraries(FileCheck PRIVATE LLVMSupport)
diff --git a/gnu/llvm/utils/FileCheck/FileCheck.cpp b/gnu/llvm/utils/FileCheck/FileCheck.cpp
index 9d808cc875c..7db97301637 100644
--- a/gnu/llvm/utils/FileCheck/FileCheck.cpp
+++ b/gnu/llvm/utils/FileCheck/FileCheck.cpp
@@ -62,6 +62,10 @@ static cl::list<std::string> ImplicitCheckNot(
"this pattern occur which are not matched by a positive pattern"),
cl::value_desc("pattern"));
+static cl::list<std::string> GlobalDefines("D", cl::Prefix,
+ cl::desc("Define a variable to be used in capture patterns."),
+ cl::value_desc("VAR=VALUE"));
+
static cl::opt<bool> AllowEmptyInput(
"allow-empty", cl::init(false),
cl::desc("Allow the input file to be empty. This is useful when making\n"
@@ -1295,6 +1299,9 @@ bool CheckInput(SourceMgr &SM, StringRef Buffer,
/// VariableTable - This holds all the current filecheck variables.
StringMap<StringRef> VariableTable;
+ for (const auto& Def : GlobalDefines)
+ VariableTable.insert(StringRef(Def).split('='));
+
unsigned i = 0, j = 0, e = CheckStrings.size();
while (true) {
StringRef CheckRegion;