Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FileCheck] Implement -v and -vv for tracing matches
-v prints all directive pattern matches. -vv additionally prints info that might be noise to users but that can be helpful to FileCheck developers. To maximize code reuse and to make diagnostics more consistent, this patch also adjusts and extends some of the existing diagnostics. CHECK-NOT failures now report variables uses. Many more diagnostics now report the check prefix and kind of directive. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D47114 llvm-svn: 336967
- Loading branch information
1 parent
01c762b
commit dc5ba31
Showing
11 changed files
with
300 additions
and
59 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
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
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
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
; RUN: FileCheck -DVALUE=10 -input-file %s %s | ||
; RUN: not FileCheck -DVALUE=20 -input-file %s %s 2>&1 | FileCheck %s -check-prefix ERRMSG | ||
; | ||
; RUN: not FileCheck -DVALUE=10 -check-prefix NOT -input-file %s %s 2>&1 | FileCheck %s -check-prefix NOT-ERRMSG | ||
; RUN: FileCheck -DVALUE=20 -check-prefix NOT -input-file %s %s | ||
|
||
Value = 10 | ||
; CHECK: Value = [[VALUE]] | ||
; NOT-NOT: Value = [[VALUE]] | ||
|
||
; ERRMSG: defines.txt:5:10: error: expected string not found in input | ||
; ERRMSG: defines.txt:8:10: error: CHECK: expected string not found in input | ||
; ERRMSG: defines.txt:1:1: note: scanning from here | ||
; ERRMSG: defines.txt:1:1: note: with variable "VALUE" equal to "20" | ||
; ERRMSG: defines.txt:4:1: note: possible intended match here | ||
; ERRMSG: defines.txt:7:1: note: possible intended match here | ||
|
||
; NOT-ERRMSG: defines.txt:9:12: error: {{NOT}}-NOT: excluded string found in input | ||
; NOT-ERRMSG: defines.txt:7:1: note: found here | ||
; NOT-ERRMSG: defines.txt:7:1: note: with variable "VALUE" equal to "10" |
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
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,115 @@ | ||
; RUN: FileCheck -input-file %s %s 2>&1 | FileCheck -check-prefix QUIET --allow-empty %s | ||
; RUN: FileCheck -v -input-file %s %s 2>&1 | FileCheck -check-prefix V %s | ||
; RUN: FileCheck -vv -input-file %s %s 2>&1 | FileCheck -check-prefixes V,VV %s | ||
|
||
foo | ||
bar | ||
CHECK: foo | ||
CHECK-NOT: raboof | ||
CHECK-NEXT: bar | ||
|
||
V: verbose.txt:[[@LINE-4]]:8: remark: {{C}}HECK: expected string found in input | ||
V-NEXT: {{C}}HECK: foo{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-9]]:1: note: found here | ||
V-NEXT: {{^}}foo{{$}} | ||
V-NEXT: {{^}}^~~{{$}} | ||
|
||
V-NEXT: verbose.txt:[[@LINE-9]]:13: remark: {{C}}HECK-NEXT: expected string found in input | ||
V-NEXT: {{C}}HECK-NEXT: bar{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-15]]:1: note: found here | ||
V-NEXT: {{^}}bar{{$}} | ||
V-NEXT: {{^}}^~~{{$}} | ||
|
||
VV-NEXT: verbose.txt:[[@LINE-17]]:12: remark: {{C}}HECK-NOT: excluded string not found in input | ||
VV-NEXT: {{C}}HECK-NOT: raboof{{$}} | ||
VV-NEXT: {{^ \^$}} | ||
VV-NEXT: verbose.txt:[[@LINE-22]]:1: note: scanning from here | ||
VV-NEXT: {{^}}bar{{$}} | ||
VV-NEXT: {{^}}^{{$}} | ||
|
||
before empty | ||
|
||
after empty | ||
CHECK: before empty | ||
CHECK-EMPTY: | ||
CHECK-NEXT: after empty | ||
|
||
V: verbose.txt:[[@LINE-4]]:8: remark: {{C}}HECK: expected string found in input | ||
V-NEXT: {{C}}HECK: before empty{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-10]]:1: note: found here | ||
V-NEXT: {{^}}before empty{{$}} | ||
V-NEXT: {{^}}^~~~~~~~~~~~{{$}} | ||
|
||
V-NEXT: verbose.txt:[[@LINE-10]]:13: remark: {{C}}HECK-EMPTY: expected string found in input | ||
V-NEXT: {{C}}HECK-EMPTY:{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-16]]:1: note: found here | ||
V-EMPTY: | ||
V-NEXT: {{^}}^{{$}} | ||
|
||
V-NEXT: verbose.txt:[[@LINE-16]]:13: remark: {{C}}HECK-NEXT: expected string found in input | ||
V-NEXT: {{C}}HECK-NEXT: after empty{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-22]]:1: note: found here | ||
V-NEXT: {{^}}after empty{{$}} | ||
V-NEXT: {{^}}^~~~~~~~~~~{{$}} | ||
|
||
abcdef | ||
abcdef | ||
CHECK-DAG: abcdef | ||
CHECK-DAG: def | ||
|
||
V-NEXT: verbose.txt:[[@LINE-3]]:12: remark: {{C}}HECK-DAG: expected string found in input | ||
V-NEXT: {{C}}HECK-DAG: abcdef | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-8]]:1: note: found here | ||
V-NEXT: {{^}}abcdef{{$}} | ||
V-NEXT: {{^}}^~~~~~{{$}} | ||
|
||
VV-NEXT: verbose.txt:[[@LINE-9]]:12: remark: {{C}}HECK-DAG: expected string found in input | ||
VV-NEXT: {{C}}HECK-DAG: def | ||
VV-NEXT: {{^ \^$}} | ||
VV-NEXT: verbose.txt:[[@LINE-15]]:4: note: found here | ||
VV-NEXT: {{^abcdef$}} | ||
VV-NEXT: {{^ \^~~$}} | ||
VV-NEXT: verbose.txt:[[@LINE-18]]:1: note: match discarded, overlaps earlier DAG match here | ||
VV-NEXT: {{^}}abcdef{{$}} | ||
VV-NEXT: {{^}}^~~~~~{{$}} | ||
|
||
V-NEXT: verbose.txt:[[@LINE-19]]:12: remark: {{C}}HECK-DAG: expected string found in input | ||
V-NEXT: {{C}}HECK-DAG: def | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-24]]:4: note: found here | ||
V-NEXT: {{^abcdef$}} | ||
V-NEXT: {{^ \^~~$}} | ||
|
||
xyz | ||
CHECK: xyz | ||
CHECK-NOT: {{z}}yx | ||
|
||
V: verbose.txt:[[@LINE-3]]:8: remark: {{C}}HECK: expected string found in input | ||
V-NEXT: {{C}}HECK: xyz{{$}} | ||
V-NEXT: {{^ \^$}} | ||
V-NEXT: verbose.txt:[[@LINE-7]]:1: note: found here | ||
V-NEXT: {{^}}xyz{{$}} | ||
V-NEXT: {{^}}^~~{{$}} | ||
|
||
VV-NEXT: verbose.txt:[[@LINE-9]]:19: remark: implicit EOF: expected string found in input | ||
VV-NEXT: {{C}}HECK-NOT: {{[{][{]z[}][}]yx$}} | ||
VV-NEXT: {{^ \^$}} | ||
VV-NEXT: verbose.txt:[[@LINE+13]]:1: note: found here | ||
VV-NOT: {{.}} | ||
VV: {{^\^$}} | ||
|
||
VV-NEXT: verbose.txt:[[@LINE-16]]:12: remark: {{C}}HECK-NOT: excluded string not found in input | ||
VV-NEXT: {{C}}HECK-NOT: {{[{][{]z[}][}]yx$}} | ||
VV-NEXT: {{^ \^$}} | ||
VV-NEXT: verbose.txt:[[@LINE-20]]:1: note: scanning from here | ||
VV-NEXT: {{^C}}HECK: xyz{{$}} | ||
VV-NEXT: {{^\^$}} | ||
|
||
QUIET-NOT: {{.}} | ||
V-NOT: {{.}} |
Oops, something went wrong.