1; Test functionality of -D option: string variables are defined to the right
2; value and CHECK directives using them match as expected given the value set.
3
4; String variable correctly defined to a non-empty string.
5RUN: FileCheck -DVALUE=10 --input-file %s %s
6RUN: not FileCheck -DVALUE=20 --input-file %s %s 2>&1 \
7RUN:   | FileCheck %s --check-prefix ERRMSG
8RUN: not FileCheck -DVALUE=10 --check-prefix NOT --input-file %s %s 2>&1 \
9RUN:   | FileCheck %s --check-prefix NOT-ERRMSG
10RUN: FileCheck -DVALUE=20 --check-prefix NOT --input-file %s %s
11
12Value = 10
13CHECK: Value = [[VALUE]]
14NOT-NOT: Value = [[VALUE]]
15
16ERRMSG: defines.txt:[[@LINE-3]]:8: error: CHECK: expected string not found in input
17ERRMSG: defines.txt:1:1: note: scanning from here
18ERRMSG: defines.txt:1:1: note: with string variable "VALUE" equal to "20"
19ERRMSG: defines.txt:[[@LINE-7]]:1: note: possible intended match here
20
21NOT-ERRMSG: defines.txt:[[@LINE-7]]:10: error: {{NOT}}-NOT: excluded string found in input
22NOT-ERRMSG: defines.txt:[[@LINE-10]]:1: note: found here
23NOT-ERRMSG: defines.txt:[[@LINE-11]]:1: note: with string variable "VALUE" equal to "10"
24
25; Definition of string variable to an empty string.
26RUN: FileCheck -DVALUE= --check-prefix EMPTY --input-file %s %s 2>&1
27
28Empty value = @@
29EMPTY: Empty value = @[[VALUE]]@
30