summaryrefslogtreecommitdiffstats
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-22 22:07:50 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-22 22:07:50 +0000
commit57cb733b46fd58cbf29214d969c95c634834a588 (patch)
treec278057c9037402939b6e5a66084790e00a871d8 /llvm/utils/FileCheck/FileCheck.cpp
parent7b8fcadf68405c5be1ee91607d895670c408391c (diff)
downloadbcm5719-llvm-57cb733b46fd58cbf29214d969c95c634834a588.tar.gz
bcm5719-llvm-57cb733b46fd58cbf29214d969c95c634834a588.zip
Allow '_' in FileCheck variable names, it is nice to have at least one
separate character. - Chris, OK? llvm-svn: 89626
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index b4d1f84859c..2bd6197e133 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -140,7 +140,7 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
// Named RegEx matches. These are of two forms: [[foo:.*]] which matches .*
// (or some other regex) and assigns it to the FileCheck variable 'foo'. The
// second form is [[foo]] which is a reference to foo. The variable name
- // itself must be of the form "[a-zA-Z][0-9a-zA-Z]*", otherwise we reject
+ // itself must be of the form "[a-zA-Z_][0-9a-zA-Z_]*", otherwise we reject
// it. This is to catch some common errors.
if (PatternStr.size() >= 2 &&
PatternStr[0] == '[' && PatternStr[1] == '[') {
@@ -167,7 +167,8 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) {
// Verify that the name is well formed.
for (unsigned i = 0, e = Name.size(); i != e; ++i)
- if ((Name[i] < 'a' || Name[i] > 'z') &&
+ if (Name[i] != '_' &&
+ (Name[i] < 'a' || Name[i] > 'z') &&
(Name[i] < 'A' || Name[i] > 'Z') &&
(Name[i] < '0' || Name[i] > '9')) {
SM.PrintMessage(SMLoc::getFromPointer(Name.data()+i),
OpenPOWER on IntegriCloud