Fix a bug in FileCheck that wouldn't let define variables as follows:
authorEli Bendersky <eliben@google.com>
Sun, 2 Dec 2012 16:02:41 +0000 (16:02 +0000)
committerEli Bendersky <eliben@google.com>
Sun, 2 Dec 2012 16:02:41 +0000 (16:02 +0000)
commit061d2baa572d4caf4aaa4c9f67c834c7154c7c2a
tree402d88ab8155bc4559e1714b3d1191f65280ee84
parentb7b1ffc8e714ed82dc52d64b2ec9498526c7ed4a
Fix a bug in FileCheck that wouldn't let define variables as follows:

; CHECK: [[VAR:[a-z]]]

The problem was that to find the end of the regex var definition, it was
simplistically looking for the next ]] and finding the incorrect one. A
better approach is to count nesting of brackets (taking escaping into
account). This way the brackets that are part of the regex can be discovered
and skipped properly, and the ]] ending is detected in the right place.

llvm-svn: 169109
llvm/test/FileCheck/regex-brackets.txt [new file with mode: 0644]
llvm/test/FileCheck/simple-var-capture.txt
llvm/utils/FileCheck/FileCheck.cpp