llvm-mirror/test/FileCheck/pattern-defines-diagnostics.txt
Thomas Preud'homme a6a999ae4c Reinstate "FileCheck [5/12]: Introduce regular numeric variables"
This reinstates r360578 (git e47362c1ec1ea31b626336cc05822035601c3e57),
reverted in r360653 (git 004393681c25e34e921adccc69ae6378090dee54),
with a fix for the list added in FileCheck.rst to build without error.

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/D60385

llvm-svn: 360665
2019-05-14 11:58:30 +00:00

50 lines
1.9 KiB
Plaintext

; Test incorrect syntax for -D option is correctly diagnosed.
; Missing equal sign.
RUN: not FileCheck -DVALUE10 --input-file %s %s 2>&1 \
RUN: | FileCheck %s --check-prefix ERRCLIEQ1
ERRCLIEQ1: Missing equal sign in command-line definition '-DVALUE10'
; Missing definition expression (variable name, equal sign and value).
RUN: not FileCheck -D --input-file %s %s 2>&1 \
RUN: | FileCheck %s --check-prefix ERRCLIEQ2
ERRCLIEQ2: {{F|f}}ile{{C|c}}heck{{[^:]*}}: for the -D option: requires a value!
; Missing variable name.
RUN: not FileCheck -D=10 --input-file %s %s 2>&1 \
RUN: | FileCheck %s --check-prefix ERRCLIVAR1
ERRCLIVAR1: Missing pattern variable name in command-line definition '-D=10'
; Missing variable name.
RUN: not FileCheck -D= --input-file %s %s 2>&1 \
RUN: | FileCheck %s --check-prefix ERRCLIVAR2
ERRCLIVAR2: Missing pattern variable name in command-line definition '-D='
; Invalid variable name: starts with a digit.
RUN: not FileCheck -D10VALUE=10 --input-file %s %s 2>&1 \
RUN: | FileCheck %s --strict-whitespace --check-prefix ERRCLIFMT
ERRCLIFMT: Global defines:1:19: error: invalid name in pattern variable definition '10VALUE'
ERRCLIFMT-NEXT: Global define #1: 10VALUE=10
ERRCLIFMT-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 ERRCLIPSEUDO
ERRCLIPSEUDO: Global defines:1:19: error: invalid name in pattern variable definition '@VALUE'
ERRCLIPSEUDO-NEXT: Global define #1: @VALUE=10
ERRCLIPSEUDO-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 ERRCLITRAIL
ERRCLITRAIL: Global defines:1:19: error: invalid name in pattern variable definition 'VALUE + 2'
ERRCLITRAIL-NEXT: Global define #1: VALUE + 2=10
ERRCLITRAIL-NEXT: {{^ \^$}}