forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new directive called CHECK-LABEL to FileCheck.
CHECK-LABEL is meant to be used in place on CHECK on lines containing identifiers or other unique labels (they need not actually be labels in the source or output language, though.) This is used to break up the input stream into separate blocks delineated by CHECK-LABEL lines, each of which is checked independently. This greatly improves the accuracy of errors and fix-it hints in many cases, and allows for FileCheck to recover from errors in one block by continuing to subsequent blocks. Some tests will be converted to use this new directive in forthcoming patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186162 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
5e102c6
commit 178504b
Showing
3 changed files
with
194 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
; RUN: FileCheck -input-file %s %s -check-prefix=CHECKOK | ||
; RUN: not FileCheck -input-file %s %s -check-prefix=CHECKFAIL 2>&1 | FileCheck %s -check-prefix=CHECKERROR | ||
|
||
label0: | ||
a | ||
b | ||
|
||
label1: | ||
b | ||
c | ||
|
||
label2: | ||
a | ||
c | ||
|
||
; CHECKOK-LABEL: {{^}}label0: | ||
; CHECKOK: {{^}}a | ||
; CHECKOK: {{^}}b | ||
|
||
; CHECKOK-LABEL: {{^}}label1: | ||
; CHECKOK: {{^}}b | ||
; CHECKOK: {{^}}c | ||
|
||
; CHECKOK-LABEL: {{^}}label2: | ||
; CHECKOK: {{^}}a | ||
; CHECKOK: {{^}}c | ||
|
||
; CHECKFAIL-LABEL: {{^}}label0: | ||
; CHECKFAIL: {{^}}a | ||
; CHECKFAIL: {{^}}b | ||
; CHECKFAIL: {{^}}c | ||
|
||
; CHECKERROR: expected string not found in input | ||
; CHECKERROR-NEXT: CHECKFAIL: {{[{][{]\^[}][}]}}c | ||
|
||
; CHECKFAIL-LABEL: {{^}}label1: | ||
; CHECKFAIL: {{^}}a | ||
; CHECKFAIL: {{^}}b | ||
; CHECKFAIL: {{^}}c | ||
|
||
; CHECKERROR: expected string not found in input | ||
; CHECKERROR-NEXT: CHECKFAIL: {{[{][{]\^[}][}]}}a | ||
|
||
; CHECKFAIL-LABEL: {{^}}label2: | ||
; CHECKFAIL: {{^}}a | ||
; CHECKFAIL: {{^}}b | ||
; CHECKFAIL: {{^}}c | ||
|
||
; CHECKERROR: expected string not found in input | ||
; CHECKERROR-NEXT: CHECKFAIL: {{[{][{]\^[}][}]}}b | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters