[Test][FileCheck] Fix use of undef var
authorThomas Preud'homme <thomasp@graphcore.ai>
Thu, 20 Aug 2020 19:41:43 +0000 (20:41 +0100)
committerThomas Preud'homme <thomasp@graphcore.ai>
Sat, 9 Jan 2021 10:45:00 +0000 (10:45 +0000)
The test related to directives with prefix NUMEXPR-CONSTRAINT-NOMATCH
refers to the numeric variable UNSI which is defined by a directive with
prefix CHECK not enabled on the lit command-line. Rather than adding the
prefix CHECK to the lit command-line, this commit defined variable UNSI
in a new NUMEXPR-CONSTRAINT-NOMATCH prefixed directive. The directive
needs to contain more than just the variable otherwise the error message
from FileCheck is about the wrong line being matched.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D93346

llvm/test/FileCheck/numeric-expression.txt

index 7969ca9..0f6c143 100644 (file)
@@ -250,12 +250,14 @@ RUN: not FileCheck --check-prefix NUMEXPR-CONSTRAINT-NOMATCH --input-file %s %s
 RUN:   | FileCheck --check-prefix NUMEXPR-CONSTRAINT-NOMATCH-MSG --strict-whitespace %s
 
 USE DEF FMT EXPL NO MATCH
-12
+UNSI=11
+UNSI: 12
 NUMEXPR-CONSTRAINT-NOMATCH-LABEL: USE DEF FMT EXPL NO MATCH
-NUMEXPR-CONSTRAINT-NOMATCH-NEXT: [[#==UNSI]]
+NUMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI=[[#UNSI:]]
+NUMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI: [[#==UNSI]]
 NUMEXPR-CONSTRAINT-NOMATCH-MSG: numeric-expression.txt:[[#@LINE-1]]:34: error: {{N}}UMEXPR-CONSTRAINT-NOMATCH-NEXT: expected string not found in input
-NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT: {{N}}UMEXPR-CONSTRAINT-NOMATCH-NEXT: {{\[\[#==UNSI\]\]}}
-NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT:   {{^}}                                 ^{{$}}
+NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT:  {{N}}UMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI: {{\[\[#==UNSI\]\]}}
+NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT: {{^}}                                 ^{{$}}
 
 ; Empty numeric expression with matching constraint.
 RUN: %ProtectFileCheckOutput \