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.
4 ; String variable correctly defined to a non-empty string.
5 RUN: FileCheck -DVALUE=10 --input-file %s %s
6 RUN: %ProtectFileCheckOutput not FileCheck -DVALUE=20 --input-file %s %s 2>&1 \
7 RUN: | FileCheck %s --check-prefix ERRMSG
8 RUN: %ProtectFileCheckOutput \
9 RUN: not FileCheck -DVALUE=10 --check-prefix NOT --input-file %s %s 2>&1 \
10 RUN: | FileCheck %s --check-prefix NOT-ERRMSG
11 RUN: FileCheck -DVALUE=20 --check-prefix NOT --input-file %s %s
14 CHECK: Value = [[VALUE]]
15 NOT-NOT: Value = [[VALUE]]
17 ERRMSG: defines.txt:[[@LINE-3]]:8: error: CHECK: expected string not found in input
18 ERRMSG: defines.txt:1:1: note: scanning from here
19 ERRMSG: defines.txt:1:1: note: with "VALUE" equal to "20"
20 ERRMSG: defines.txt:[[@LINE-7]]:1: note: possible intended match here
22 NOT-ERRMSG: defines.txt:[[@LINE-7]]:10: error: {{NOT}}-NOT: excluded string found in input
23 NOT-ERRMSG: defines.txt:[[@LINE-10]]:1: note: found here
24 NOT-ERRMSG: defines.txt:[[@LINE-11]]:1: note: with "VALUE" equal to "10"
26 ; Definition of string variable to an empty string.
27 RUN: FileCheck -DVALUE= --check-prefix EMPTY --input-file %s %s 2>&1
30 EMPTY: Empty value = @[[VALUE]]@