1 ; Test functionality of -D# option: numeric variables are defined to the right
2 ; value and CHECK directives using them match as expected given the value set.
4 ; Tests with default format specifier.
5 RUN: FileCheck -D#NUMVAL1=8 -D#NUMVAL2='NUMVAL1 + 4' --check-prefixes CHECKNUM1,CHECKNUM2 --input-file %s %s
7 RUN: %ProtectFileCheckOutput \
8 RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 --check-prefix CHECKNUM1 --input-file %s %s 2>&1 \
9 RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG1
11 RUN: %ProtectFileCheckOutput \
12 RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 --check-prefix CHECKNUM2 --input-file %s %s 2>&1 \
13 RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG2
15 RUN: %ProtectFileCheckOutput \
16 RUN: not FileCheck -D#NUMVAL1=8 -D#NUMVAL2=8 --check-prefix NUMNOT1 --input-file %s %s 2>&1 \
17 RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG1
19 RUN: %ProtectFileCheckOutput \
20 RUN: not FileCheck -D#NUMVAL1=7 -D#NUMVAL2=12 --check-prefix NUMNOT1 --input-file %s %s 2>&1 \
21 RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG2
23 RUN: FileCheck -D#NUMVAL1=7 -D#NUMVAL2=8 --check-prefix NUMNOT1 --input-file %s %s
27 CHECKNUM1: Numeric value #1 = [[#NUMVAL1]]
28 CHECKNUM2: Numeric value #2 = [[#NUMVAL2]]
29 NUMNOT1-NOT: Numeric value #1 = [[#NUMVAL1]]
30 NUMNOT1-NOT: Numeric value #2 = [[#NUMVAL2]]
32 NUMERRMSG1: defines.txt:[[#@LINE-5]]:12: error: CHECKNUM1: expected string not found in input
33 NUMERRMSG1: defines.txt:1:1: note: scanning from here
34 NUMERRMSG1: defines.txt:1:1: note: with "NUMVAL1" equal to "7"
35 NUMERRMSG1: defines.txt:[[#@LINE-10]]:1: note: possible intended match here
37 NUMERRMSG2: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM2: expected string not found in input
38 NUMERRMSG2: defines.txt:1:1: note: scanning from here
39 NUMERRMSG2: defines.txt:1:1: note: with "NUMVAL2" equal to "8"
40 NUMERRMSG2: defines.txt:[[#@LINE-14]]:1: note: possible intended match here
42 NOT-NUMERRMSG1: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT1}}-NOT: excluded string found in input
43 NOT-NUMERRMSG1: defines.txt:[[#@LINE-18]]:1: note: found here
44 NOT-NUMERRMSG1: defines.txt:[[#@LINE-19]]:1: note: with "NUMVAL1" equal to "8"
46 NOT-NUMERRMSG2: defines.txt:[[#@LINE-16]]:14: error: {{NUMNOT1}}-NOT: excluded string found in input
47 NOT-NUMERRMSG2: defines.txt:[[#@LINE-21]]:1: note: found here
48 NOT-NUMERRMSG2: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL2" equal to "12"
50 ; Tests with explicit format specifiers.
51 RUN: FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s
53 RUN: %ProtectFileCheckOutput \
54 RUN: not FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=12 --check-prefix CHECKNUM3 --input-file %s %s 2>&1 \
55 RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG3
57 RUN: %ProtectFileCheckOutput \
58 RUN: not FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4=8 --check-prefix CHECKNUM4 --input-file %s %s 2>&1 \
59 RUN: | FileCheck %s --strict-whitespace --check-prefix NUMERRMSG4
61 RUN: %ProtectFileCheckOutput \
62 RUN: not FileCheck -D#%X,NUMVAL3=8 -D#%X,NUMVAL4=8 --check-prefix NUMNOT2 --input-file %s %s 2>&1 \
63 RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG3
65 RUN: %ProtectFileCheckOutput \
66 RUN: not FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=12 --check-prefix NUMNOT2 --input-file %s %s 2>&1 \
67 RUN: | FileCheck %s --strict-whitespace --check-prefix NOT-NUMERRMSG4
69 RUN: FileCheck -D#%X,NUMVAL3=7 -D#%X,NUMVAL4=8 --check-prefix NUMNOT2 --input-file %s %s
71 ; Test with explicit and default format specifiers.
72 RUN: FileCheck -D#NUMVAL3=8 -D#%X,NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s
73 ; Test with explicit and implicit format specifiers.
74 RUN: FileCheck -D#%X,NUMVAL3=8 -D#NUMVAL4='NUMVAL3 + 4' --check-prefixes CHECKNUM3,CHECKNUM4 --input-file %s %s
78 CHECKNUM3: Numeric value #3 = [[#NUMVAL3]]
79 CHECKNUM4: Numeric value #4 = [[#NUMVAL4]]
80 NUMNOT2-NOT: Numeric value #3 = [[#NUMVAL3]]
81 NUMNOT2-NOT: Numeric value #4 = [[#NUMVAL4]]
83 NUMERRMSG3: defines.txt:[[#@LINE-5]]:12: error: CHECKNUM3: expected string not found in input
84 NUMERRMSG3: defines.txt:1:1: note: scanning from here
85 NUMERRMSG3: defines.txt:1:1: note: with "NUMVAL3" equal to "7"
86 NUMERRMSG3: defines.txt:[[#@LINE-10]]:1: note: possible intended match here
88 NUMERRMSG4: defines.txt:[[#@LINE-9]]:12: error: CHECKNUM4: expected string not found in input
89 NUMERRMSG4: defines.txt:1:1: note: scanning from here
90 NUMERRMSG4: defines.txt:1:1: note: with "NUMVAL4" equal to "8"
91 NUMERRMSG4: defines.txt:[[#@LINE-14]]:1: note: possible intended match here
93 NOT-NUMERRMSG3: defines.txt:[[#@LINE-13]]:14: error: {{NUMNOT2}}-NOT: excluded string found in input
94 NOT-NUMERRMSG3: defines.txt:[[#@LINE-18]]:1: note: found here
95 NOT-NUMERRMSG3: defines.txt:[[#@LINE-19]]:1: note: with "NUMVAL3" equal to "8"
97 NOT-NUMERRMSG4: defines.txt:[[#@LINE-16]]:14: error: {{NUMNOT2}}-NOT: excluded string found in input
98 NOT-NUMERRMSG4: defines.txt:[[#@LINE-21]]:1: note: found here
99 NOT-NUMERRMSG4: defines.txt:[[#@LINE-22]]:1: note: with "NUMVAL4" equal to "C"