From 178504b07b793b3fde46d950b8f10e0794193e02 Mon Sep 17 00:00:00 2001 From: Stephen Lin Date: Fri, 12 Jul 2013 14:51:05 +0000 Subject: 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 --- test/FileCheck/check-label.txt | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 test/FileCheck/check-label.txt (limited to 'test/FileCheck') diff --git a/test/FileCheck/check-label.txt b/test/FileCheck/check-label.txt new file mode 100644 index 0000000000..27f0beeb29 --- /dev/null +++ b/test/FileCheck/check-label.txt @@ -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 + -- cgit v1.2.3