diff options
| author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-05-02 00:04:38 +0000 |
|---|---|---|
| committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-05-02 00:04:38 +0000 |
| commit | 288ed91e99d80413f8d1bcab12d75dc9360715f3 (patch) | |
| tree | db65c351241b2794f70196305cefbef3fd756438 /llvm/test/FileCheck | |
| parent | 2efd30571bcc53003376410d4221f7e4dd19f4c3 (diff) | |
| download | bcm5719-llvm-288ed91e99d80413f8d1bcab12d75dc9360715f3.tar.gz bcm5719-llvm-288ed91e99d80413f8d1bcab12d75dc9360715f3.zip | |
FileCheck [4/12]: Introduce @LINE numeric expressions
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch introduces the @LINE numeric
expressions.
This commit introduces a new syntax to express a relation a numeric
value in the input text must have with the line number of a given CHECK
pattern: [[#<@LINE numeric expression>]]. Further commits build on that
to express relations between several numeric values in the input text.
To help with naming, regular variables are renamed into pattern
variables and old @LINE expression syntax is referred to as legacy
numeric expression.
Compared to existing @LINE expressions, this new syntax allow arbitrary
spacing between the component of the expression. It offers otherwise the
same functionality but the commit serves to introduce some of the data
structure needed to support more general numeric expressions.
Copyright:
- Linaro (changes up to diff 183612 of revision D55940)
- GraphCore (changes in later versions of revision D55940 and
in new revision created off D55940)
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60384
llvm-svn: 359741
Diffstat (limited to 'llvm/test/FileCheck')
| -rw-r--r-- | llvm/test/FileCheck/line-count.txt | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/llvm/test/FileCheck/line-count.txt b/llvm/test/FileCheck/line-count.txt index 9274685b7a2..d685dc7bd2b 100644 --- a/llvm/test/FileCheck/line-count.txt +++ b/llvm/test/FileCheck/line-count.txt @@ -1,4 +1,4 @@ -; RUN: FileCheck -input-file %s %s +; RUN: FileCheck -input-file %s %s ; RUN: not FileCheck -check-prefix BAD1 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR1 %s ; RUN: not FileCheck -check-prefix BAD2 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR2 %s ; RUN: not FileCheck -check-prefix BAD3 -input-file %s %s 2>&1 | FileCheck -check-prefix ERR3 %s @@ -23,34 +23,44 @@ 23 arst CHECK: [[@LINE]] {{a}}rst 24 25 BAD1: [[@LINE:cant-have-regex]] -26 ERR1: line-count.txt:[[@LINE-1]]:12: error: invalid name in named regex definition +26 ERR1: line-count.txt:[[#@LINE-1]]:12: error: invalid name in pattern variable definition 27 28 BAD2: [[ @LINE]] -29 ERR2: line-count.txt:[[@LINE-1]]:12: error: unexpected whitespace +29 ERR2: line-count.txt:[[#@LINE-1]]:12: error: unexpected whitespace 30 31 BAD3: [[@LINE ]] -32 ERR3: line-count.txt:[[@LINE-1]]:17: error: unexpected whitespace +32 ERR3: line-count.txt:[[#@LINE-1]]:17: error: unexpected whitespace 33 34 BAD4: [[ @LINE-1]] -35 ERR4: line-count.txt:[[@LINE-1]]:12: error: unexpected whitespace +35 ERR4: line-count.txt:[[#@LINE-1]]:12: error: unexpected whitespace 36 37 BAD5: [[@LINE -1]] -38 ERR5: line-count.txt:[[@LINE-1]]:17: error: unexpected whitespace +38 ERR5: line-count.txt:[[#@LINE-1]]:17: error: unexpected whitespace 39 40 BAD6: [[@LINE- 1]] -41 ERR6: line-count.txt:[[@LINE-1]]:18: error: unexpected whitespace +41 ERR6: line-count.txt:[[#@LINE-1]]:18: error: unexpected whitespace 42 43 BAD7: [[@LINE-1 ]] -44 ERR7: line-count.txt:[[@LINE-1]]:19: error: unexpected whitespace +44 ERR7: line-count.txt:[[#@LINE-1]]:19: error: unexpected whitespace 45 46 BAD8: [[@LIN]] -47 ERR8: line-count.txt:[[@LINE-1]]:12: error: invalid pseudo variable '@LIN' +47 ERR8: line-count.txt:[[#@LINE-1]]:12: error: invalid pseudo numeric variable '@LIN' 48 49 BAD9: [[@LINE*2]] -50 ERR9: line-count.txt:[[@LINE-1]]:17: error: unsupported numeric operation '*' +50 ERR9: line-count.txt:[[#@LINE-1]]:17: error: unsupported numeric operation '*' 51 52 BAD10: [[@LINE-x]] -53 ERR10: line-count.txt:[[@LINE-1]]:19: error: invalid offset in numeric expression 'x' +53 ERR10: line-count.txt:[[#@LINE-1]]:19: error: invalid offset in numeric expression 'x' 54 55 BAD11: [[@LINE-1x]] -56 ERR11: line-count.txt:[[@LINE-1]]:19: error: unexpected characters at end of numeric expression 'x' +56 ERR11: line-count.txt:[[#@LINE-1]]:19: error: unexpected characters at end of numeric expression 'x' +57 +58 CHECK: [[#@LINE]] CHECK +59 CHECK: [[# @LINE]] CHECK +60 CHECK: [[# @LINE ]] CHECK +61 +62 CHECK: [[#@LINE-1]] +63 CHECK: [[# @LINE-1]] CHECK +64 CHECK: [[# @LINE -1]] CHECK +65 CHECK: [[# @LINE - 1]] CHECK +66 CHECK: [[# @LINE - 1 ]] CHECK |

