1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 08:23:21 +01:00
llvm-mirror/test/FileCheck/check-label.txt
Stephen Lin 7148920f58 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.

llvm-svn: 186162
2013-07-12 14:51:05 +00:00

52 lines
985 B
Plaintext

; 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