1 ; Test incorrect syntax for -D option is correctly diagnosed.
4 RUN: not FileCheck -DVALUE10 --input-file %s %s 2>&1 \
5 RUN: | FileCheck %s --check-prefix ERRCLIEQ1
7 ERRCLIEQ1: Missing equal sign in command-line definition '-DVALUE10'
9 ; Missing definition expression (variable name, equal sign and value).
10 RUN: not FileCheck -D --input-file %s %s 2>&1 \
11 RUN: | FileCheck %s --check-prefix ERRCLIEQ2
13 ERRCLIEQ2: {{F|f}}ile{{C|c}}heck{{[^:]*}}: for the -D option: requires a value!
15 ; Missing variable name.
16 RUN: not FileCheck -D=10 --input-file %s %s 2>&1 \
17 RUN: | FileCheck %s --check-prefix ERRCLIVAR1
19 ERRCLIVAR1: Missing variable name in command-line definition '-D=10'
21 ; Missing variable name.
22 RUN: not FileCheck -D= --input-file %s %s 2>&1 \
23 RUN: | FileCheck %s --check-prefix ERRCLIVAR2
25 ERRCLIVAR2: Missing variable name in command-line definition '-D='
27 ; Invalid variable name: starts with a digit.
28 RUN: not FileCheck -D10VALUE=10 --input-file %s %s 2>&1 \
29 RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix ERRCLIFMT
31 ERRCLIFMT:Global defines:1:19: error: invalid variable name
32 ERRCLIFMT-NEXT:Global define #1: 10VALUE=10
35 ; Invalid definition of pseudo variable.
36 RUN: not FileCheck -D@VALUE=10 --input-file %s %s 2>&1 \
37 RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix ERRCLIPSEUDO
39 ERRCLIPSEUDO:Global defines:1:19: error: invalid name in string variable definition '@VALUE'
40 ERRCLIPSEUDO-NEXT:Global define #1: @VALUE=10
43 ; Invalid definition of an expression.
44 RUN: not FileCheck -D'VALUE + 2=10' --input-file %s %s 2>&1 \
45 RUN: | FileCheck %s --strict-whitespace --check-prefix ERRCLITRAIL
47 ERRCLITRAIL:Global defines:1:19: error: invalid name in string variable definition 'VALUE + 2'
48 ERRCLITRAIL-NEXT:Global define #1: VALUE + 2=10