diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-09 06:37:03 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-09 06:37:03 +0000 |
commit | 42e31dfd4f3c7fe8f83c930cd3a1700cef6914ea (patch) | |
tree | 1001f20bad91c542ec93aa33d3c60a907c648c57 /utils/FileCheck | |
parent | b99e000d79d30eaccfef00e3efd7ffe9a0956da7 (diff) |
fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which
is substantially different than a(b|c)d. Form the latter regex instead.
This found a few problems in the testsuite, which serves as its test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r-- | utils/FileCheck/FileCheck.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp index 58001b73ab..f225594865 100644 --- a/utils/FileCheck/FileCheck.cpp +++ b/utils/FileCheck/FileCheck.cpp @@ -148,8 +148,16 @@ bool Pattern::ParsePattern(StringRef PatternStr, SourceMgr &SM) { return true; } + // Enclose {{}} patterns in parens just like [[]] even though we're not + // capturing the result for any purpose. This is required in case the + // expression contains an alternation like: CHECK: abc{{x|z}}def. We + // want this to turn into: "abc(x|z)def" not "abcx|zdef". + RegExStr += '('; + ++CurParen; + if (AddRegExToRegEx(PatternStr.substr(2, End-2), CurParen, SM)) return true; + RegExStr += ')'; PatternStr = PatternStr.substr(End+2); continue; |