summaryrefslogtreecommitdiff
path: root/test/FileCheck
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-11-13 11:56:22 +0000
committerAlexey Samsonov <samsonov@google.com>2013-11-13 11:56:22 +0000
commit7df66416541b2001f2eb34eda543e2202617ba85 (patch)
treee828bba1feea51a1397eb17a3e7adce13cb2a264 /test/FileCheck
parent8b99622b9b0902c709a33a07efb3461bc7830852 (diff)
downloadllvm-7df66416541b2001f2eb34eda543e2202617ba85.tar.gz
llvm-7df66416541b2001f2eb34eda543e2202617ba85.tar.bz2
llvm-7df66416541b2001f2eb34eda543e2202617ba85.tar.xz
FileCheck: fix a bug with multiple --check-prefix options.
Summary: This fixes a subtle bug in new FileCheck feature added in r194343. When we search for the first satisfying check-prefix, we should actually return the first encounter of some check-prefix as a substring, even if it's not a part of valid check-line. Otherwise "FileCheck --check-prefix=FOO --check-prefix=BAR" with check file: FOO not a vaild check-line FOO: foo BAR: bar incorrectly accepted file: fog bar as it skipped the first two encounters of FOO, matching only BAR: line. Reviewers: arsenm, dsanders Reviewed By: dsanders CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2166 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FileCheck')
-rw-r--r--test/FileCheck/check-multiple-prefixes-nomatch.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/FileCheck/check-multiple-prefixes-nomatch.txt b/test/FileCheck/check-multiple-prefixes-nomatch.txt
new file mode 100644
index 0000000000..9d3835985f
--- /dev/null
+++ b/test/FileCheck/check-multiple-prefixes-nomatch.txt
@@ -0,0 +1,10 @@
+; RUN: not FileCheck -input-file %s %s -check-prefix=FOO -check-prefix=BAR 2>&1 | FileCheck %s
+
+BAR
+bar
+foo
+; BAR: ba{{z}}
+; FOO: fo{{o}}
+
+; CHECK: {{error: expected string not found in input}}
+; CHECK-NEXT: {{B}}AR: ba{{[{][{]z[}][}]}}