diff options
| author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-07-24 07:32:34 +0000 |
|---|---|---|
| committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-07-24 07:32:34 +0000 |
| commit | 5ecb8802414ce55affd02a54ee7b1cff76ae1397 (patch) | |
| tree | 19897e42656ff8f4d9a71f453c709978594d1567 /llvm/test/FileCheck | |
| parent | 75299de1911c899b7fb014ed73b24f1541fa21e9 (diff) | |
| download | bcm5719-llvm-5ecb8802414ce55affd02a54ee7b1cff76ae1397.tar.gz bcm5719-llvm-5ecb8802414ce55affd02a54ee7b1cff76ae1397.zip | |
Revert "FileCheck [8/12]: Define numeric var from expr"
This reverts commit 1b05977538d9487aa845ee2f3bec8b89c63c4f29.
llvm-svn: 366872
Diffstat (limited to 'llvm/test/FileCheck')
| -rw-r--r-- | llvm/test/FileCheck/numeric-defines-diagnostics.txt | 26 | ||||
| -rw-r--r-- | llvm/test/FileCheck/numeric-defines.txt | 48 | ||||
| -rw-r--r-- | llvm/test/FileCheck/numeric-expression.txt | 35 |
3 files changed, 36 insertions, 73 deletions
diff --git a/llvm/test/FileCheck/numeric-defines-diagnostics.txt b/llvm/test/FileCheck/numeric-defines-diagnostics.txt index 2d320a2c7ee..bee0b402699 100644 --- a/llvm/test/FileCheck/numeric-defines-diagnostics.txt +++ b/llvm/test/FileCheck/numeric-defines-diagnostics.txt @@ -4,22 +4,30 @@ RUN: not FileCheck -D#10VALUE=10 --input-file %s %s 2>&1 \ RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRCLIFMT -NUMERRCLIFMT: Global defines:1:46: error: invalid variable name -NUMERRCLIFMT-NEXT: Global define #1: #10VALUE=10 (parsed as: {{\[\[#10VALUE:10\]\]}}) -NUMERRCLIFMT-NEXT: {{^ \^$}} +NUMERRCLIFMT: Global defines:1:20: error: invalid variable name +NUMERRCLIFMT-NEXT: Global define #1: #10VALUE=10 +NUMERRCLIFMT-NEXT: {{^ \^$}} ; Invalid definition of pseudo variable. RUN: not FileCheck -D#@VALUE=10 --input-file %s %s 2>&1 \ RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRCLIPSEUDO -NUMERRCLIPSEUDO: Global defines:1:45: error: definition of pseudo numeric variable unsupported -NUMERRCLIPSEUDO-NEXT: Global define #1: #@VALUE=10 (parsed as: {{\[\[#@VALUE:10\]\]}}) -NUMERRCLIPSEUDO-NEXT: {{^ \^$}} +NUMERRCLIPSEUDO: Global defines:1:20: error: definition of pseudo numeric variable unsupported +NUMERRCLIPSEUDO-NEXT: Global define #1: #@VALUE=10 +NUMERRCLIPSEUDO-NEXT: {{^ \^$}} ; Invalid definition of an expression. RUN: not FileCheck -D#VALUE+2=10 --input-file %s %s 2>&1 \ RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRCLITRAIL -NUMERRCLITRAIL: Global defines:1:51: error: unexpected characters after numeric variable name -NUMERRCLITRAIL-NEXT: Global define #1: #VALUE+2=10 (parsed as: {{\[\[#VALUE\+2:10\]\]}}) -NUMERRCLITRAIL-NEXT: {{^ \^$}} +NUMERRCLITRAIL: Global defines:1:25: error: unexpected characters after numeric variable name +NUMERRCLITRAIL-NEXT: Global define #1: #VALUE+2=10 +NUMERRCLITRAIL-NEXT: {{^ \^$}} + +; Invalid value: numeric expression instead of literal. +RUN: not FileCheck -D#VALUE1=3 -D#VALUE2='VALUE1 + 2' --input-file %s %s 2>&1 \ +RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRCLIEXPR + +NUMERRCLIEXPR: Global defines:2:27: error: invalid value in numeric variable definition 'VALUE1 + 2' +NUMERRCLIEXPR-NEXT: Global define #2: #VALUE2=VALUE1 + 2 +NUMERRCLIEXPR-NEXT: {{^ \^$}} diff --git a/llvm/test/FileCheck/numeric-defines.txt b/llvm/test/FileCheck/numeric-defines.txt index 2ace5bad3f2..bbdd8e8c69e 100644 --- a/llvm/test/FileCheck/numeric-defines.txt +++ b/llvm/test/FileCheck/numeric-defines.txt @@ -1,38 +1,22 @@ ; Test functionality of -D# option: numeric variables are defined to the right ; value and CHECK directives using them match as expected given the value set. -RUN: FileCheck -D#NUMVAL1=8 -D#NUMVAL2='NUMVAL1 + 4' -check-prefixes CHECKNUM1,CHECKNUM2 -input-file %s %s -RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 -check-prefix CHECKNUM1 -input-file %s %s 2>&1 \ -RUN: | FileCheck %s --strict-whitespace -check-prefix NUMERRMSG1 -RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 -check-prefix CHECKNUM2 -input-file %s %s 2>&1 \ -RUN: | FileCheck %s --strict-whitespace -check-prefix NUMERRMSG2 -RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 -check-prefix NUMNOT -input-file %s %s 2>&1 \ -RUN: | FileCheck %s --strict-whitespace -check-prefixes NOT-NUMERRMSG1 -RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 -check-prefix NUMNOT -input-file %s %s 2>&1 \ -RUN: | FileCheck %s --strict-whitespace -check-prefixes NOT-NUMERRMSG2 -RUN: FileCheck -D#NUMVAL1=7 -D#NUMVAL2=8 -check-prefixes NUMNOT -input-file %s %s +RUN: FileCheck -D#NUMVAL=12 --check-prefix CHECKNUM --input-file %s %s +RUN: not FileCheck -D#NUMVAL=8 --check-prefix CHECKNUM --input-file %s %s 2>&1 \ +RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG +RUN: not FileCheck -D#NUMVAL=12 --check-prefix NUMNOT --input-file %s %s 2>&1 \ +RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG +RUN: FileCheck -D#NUMVAL=8 --check-prefixes NUMNOT --input-file %s %s -Numeric value #1 = 8 -Numeric value #2 = 12 -CHECKNUM1: Numeric value #1 = [[#NUMVAL1]] -CHECKNUM2: Numeric value #2 = [[#NUMVAL2]] -NUMNOT-NOT: Numeric value #1 = [[#NUMVAL1]] -NUMNOT-NOT: Numeric value #2 = [[#NUMVAL2]] +Numeric value = 12 +CHECKNUM: Numeric value = [[#NUMVAL]] +NUMNOT-NOT: Numeric value = [[#NUMVAL]] -NUMERRMSG1: defines.txt:[[#@LINE-5]]:12: error: CHECKNUM1: expected string not found in input -NUMERRMSG1: defines.txt:1:1: note: scanning from here -NUMERRMSG1: defines.txt:1:1: note: with "NUMVAL1" equal to "7" -NUMERRMSG1: defines.txt:[[#@LINE-10]]:1: note: possible intended match here +NUMERRMSG: defines.txt:[[#@LINE-3]]:11: error: CHECKNUM: expected string not found in input +NUMERRMSG: defines.txt:1:1: note: scanning from here +NUMERRMSG: defines.txt:1:1: note: with "NUMVAL" equal to "8" +NUMERRMSG: defines.txt:[[#@LINE-7]]:1: note: possible intended match here -NUMERRMSG2: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM2: expected string not found in input -NUMERRMSG2: defines.txt:1:1: note: scanning from here -NUMERRMSG2: defines.txt:1:1: note: with "NUMVAL2" equal to "8" -NUMERRMSG2: defines.txt:[[#@LINE-14]]:1: note: possible intended match here - -NOT-NUMERRMSG1: defines.txt:[[#@LINE-13]]:13: error: {{NUMNOT}}-NOT: excluded string found in input -NOT-NUMERRMSG1: defines.txt:[[#@LINE-18]]:1: note: found here -NOT-NUMERRMSG1: defines.txt:[[#@LINE-19]]:1: note: with "NUMVAL1" equal to "8" - -NOT-NUMERRMSG2: defines.txt:[[#@LINE-16]]:13: error: {{NUMNOT}}-NOT: excluded string found in input -NOT-NUMERRMSG2: defines.txt:[[#@LINE-21]]:1: note: found here -NOT-NUMERRMSG2: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL2" equal to "12" +NOT-NUMERRMSG: defines.txt:[[#@LINE-7]]:13: error: {{NUMNOT}}-NOT: excluded string found in input +NOT-NUMERRMSG: defines.txt:[[#@LINE-10]]:1: note: found here +NOT-NUMERRMSG: defines.txt:[[#@LINE-11]]:1: note: with "NUMVAL" equal to "12" diff --git a/llvm/test/FileCheck/numeric-expression.txt b/llvm/test/FileCheck/numeric-expression.txt index 3245adc85c3..29abc385650 100644 --- a/llvm/test/FileCheck/numeric-expression.txt +++ b/llvm/test/FileCheck/numeric-expression.txt @@ -82,20 +82,6 @@ CHECK-LABEL: USE MULTI VAR CHECK-NEXT: [[#VAR2:]] CHECK-NEXT: [[#VAR1+VAR2]] -; Numeric expression using a variable defined from a numeric expression. -DEF EXPR GOOD MATCH -42 -41 43 -; CHECK-LABEL: DEF EXPR GOOD MATCH -; CHECK-NEXT: [[# VAR42:VAR1+31]] -; CHECK-NEXT: [[# VAR41: VAR42-1]] [[# VAR41 + 2]] - -; Empty numeric expression. -EMPTY NUM EXPR -foo 104 bar -; CHECK-LABEL: EMPTY NUM EXPR -; CHECK-NEXT: foo [[#]] bar - ; Numeric expression using undefined variables. RUN: not FileCheck --check-prefix UNDEF-USE --input-file %s %s 2>&1 \ RUN: | FileCheck --strict-whitespace --check-prefix UNDEF-USE-MSG %s @@ -159,9 +145,9 @@ CLI-STR-CONFLICT-NEXT: {{^ \^$}} INPUT-NUM-CONFLICT: numeric-expression.txt:[[#@LINE-7]]:22: error: string variable with name 'STRVAR' already exists INPUT-NUM-CONFLICT-NEXT: CONFLICT4: redef2 {{\[\[#STRVAR:\]\]}} INPUT-NUM-CONFLICT-NEXT: {{^ \^$}} -CLI-NUM-CONFLICT: Global defines:2:45: error: string variable with name 'STRVAR' already exists -CLI-NUM-CONFLICT-NEXT: Global define #2: #STRVAR=42 (parsed as: {{\[\[#STRVAR:42\]\]}}) -CLI-NUM-CONFLICT-NEXT: {{^ \^$}} +CLI-NUM-CONFLICT: Global defines:2:20: error: string variable with name 'STRVAR' already exists +CLI-NUM-CONFLICT-NEXT: Global define #2: #STRVAR=42 +CLI-NUM-CONFLICT-NEXT: {{^ \^$}} ; Numeric variable definition with too big value. RUN: not FileCheck --check-prefix BIGVAL --input-file %s %s 2>&1 \ @@ -174,18 +160,3 @@ BIGVAL-NEXT: NUMVAR: [[#NUMVAR:]] BIGVAL-MSG: numeric-expression.txt:[[#@LINE-3]]:9: error: Unable to represent numeric value BIGVAL-MSG-NEXT: {{N}}UMVAR: 10000000000000000000000 BIGVAL-MSG-NEXT: {{^ \^$}} - -; Verify that when a variable is set to an expression the expression is still -; checked. -RUN: not FileCheck --check-prefix DEF-EXPR-FAIL --input-file %s %s 2>&1 \ -RUN: | FileCheck --strict-whitespace --check-prefix DEF-EXPR-FAIL-MSG %s - -DEF EXPR WRONG MATCH -20 -43 -DEF-EXPR-FAIL-LABEL: DEF EXPR WRONG MATCH -DEF-EXPR-FAIL-NEXT: [[# VAR20:]] -DEF-EXPR-FAIL-NEXT: [[# VAR42: VAR20+22]] -DEF-EXPR-FAIL-MSG: numeric-expression.txt:[[#@LINE-1]]:21: error: {{D}}EF-EXPR-FAIL-NEXT: is not on the line after the previous match -DEF-EXPR-FAIL-MSG-NEXT: {{D}}EF-EXPR-FAIL-NEXT: {{\[\[# VAR42: VAR20\+22\]\]}} -DEF-EXPR-FAIL-MSG-NEXT: {{^ \^$}} |

