1 RUN: FileCheck --input-file %s %s
3 ; We use CHECK-NEXT directives to force a match on all lines with digits.
5 ; Numeric variable definition with default matching format without spaces.
6 DEF DEFAULT FMT NO SPC // CHECK-LABEL: DEF DEFAULT FMT NO SPC
7 10 // CHECK-NEXT: {{^}}[[#UNSI:]]
9 ; Numeric variable definition with default matching format with different
11 DEF DEFAULT FMT SPC // CHECK-LABEL: DEF DEFAULT FMT SPC
12 11 // CHECK-NEXT: {{^}}[[# UNSIa:]]
13 11 // CHECK-NEXT: {{^}}[[# UNSIb :]]
14 11 // CHECK-NEXT: {{^}}[[# UNSIc : ]]
16 ; Numeric variable redefinition.
17 REDEF NO SPC // CHECK-LABEL: REDEF
18 11 // CHECK-NEXT: {{^}}[[#UNSI:]]
20 ; Numeric variable definition with explicit matching format.
21 DEF FMT // CHECK-LABEL: DEF FMT
22 c // CHECK-NEXT: {{^}}[[#%x,LHEX:]]
23 D // CHECK-NEXT: {{^}}[[#%X,UHEX:]]
24 -30 // CHECK-NEXT: {{^}}[[#%d,SIGN:]]
26 ; Numeric variable definition with explicit matching format with different
28 DEF FMT SPC // CHECK-LABEL: DEF FMT SPC
29 c // CHECK-NEXT: {{^}}[[# %x , LHEXa : ]]
31 ; Numeric variable definition with unsupported matching format.
32 RUN: %ProtectFileCheckOutput \
33 RUN: not FileCheck --check-prefixes ERR,INVALID-FMT-SPEC1 --input-file %s %s 2>&1 \
34 RUN: | FileCheck --check-prefix INVALID-FMT-SPEC-MSG1 --strict-whitespace %s
35 RUN: %ProtectFileCheckOutput \
36 RUN: not FileCheck --check-prefixes ERR,INVALID-FMT-SPEC2 --input-file %s %s 2>&1 \
37 RUN: | FileCheck --check-prefix INVALID-FMT-SPEC-MSG2 --strict-whitespace %s
42 ERR-LABEL: DEF INVALID FMT
43 INVALID-FMT-SPEC1-NEXT: INVVAR1=[[#%c,INVVAR1:]]
44 INVALID-FMT-SPEC2-NEXT: INVVAR2=[[#%hhd,INVVAR2:]]
45 INVALID-FMT-SPEC-MSG1: numeric-expression.txt:[[#@LINE-2]]:37: error: invalid format specifier in expression
46 INVALID-FMT-SPEC-MSG1-NEXT: {{I}}NVALID-FMT-SPEC1-NEXT: INVVAR1={{\[\[#%c,INVVAR1:\]\]}}
47 INVALID-FMT-SPEC-MSG1-NEXT: {{^}} ^{{$}}
48 INVALID-FMT-SPEC-MSG2: numeric-expression.txt:[[#@LINE-4]]:37: error: invalid format specifier in expression
49 INVALID-FMT-SPEC-MSG2-NEXT: {{I}}NVALID-FMT-SPEC2-NEXT: INVVAR2={{\[\[#%hhd,INVVAR2:\]\]}}
50 INVALID-FMT-SPEC-MSG2-NEXT: {{^}} ^{{$}}
52 ; Numeric variable definition of hex value with 0x prefix.
53 DEF ALT FORM // CHECK-LABEL: DEF ALT FORM
54 0xf // CHECK-NEXT: {{^}}[[#%#x,PREFIXED_LHEX:]]
55 0xE // CHECK-NEXT: {{^}}[[#%#X,PREFIXED_UHEX:]]
57 ; Invalid numeric variable definition of non-hex value with 0x prefix.
58 RUN: %ProtectFileCheckOutput \
59 RUN: not FileCheck --check-prefixes INVALID-ALT-FORM,INVALID-ALT-FORM1 --input-file %s %s 2>&1 \
60 RUN: | FileCheck --check-prefix INVALID-ALT-FORM-MSG1 --strict-whitespace %s
61 RUN: %ProtectFileCheckOutput \
62 RUN: not FileCheck --check-prefixes INVALID-ALT-FORM,INVALID-ALT-FORM2 --input-file %s %s 2>&1 \
63 RUN: | FileCheck --check-prefix INVALID-ALT-FORM-MSG2 --strict-whitespace %s
66 INVALID-ALT-FORM-LABEL: DEF INVALID ALT FORM
67 INVALID-ALT-FORM1-NEXT: PREFIXED_DEC=[[#%#u,PREFIXED_UNSI:]]
68 INVALID-ALT-FORM2-NEXT: PREFIXED_DEC=[[#%#d,PREFIXED_SIGN:]]
69 INVALID-ALT-FORM-MSG1: numeric-expression.txt:[[#@LINE-2]]:42: error: alternate form only supported for hex values
70 INVALID-ALT-FORM-MSG1-NEXT: {{I}}NVALID-ALT-FORM1-NEXT: PREFIXED_DEC={{\[\[#%#u,PREFIXED_UNSI:\]\]}}
71 INVALID-ALT-FORM-MSG1-NEXT: {{^}} ^{{$}}
72 INVALID-ALT-FORM-MSG2: numeric-expression.txt:[[#@LINE-4]]:42: error: alternate form only supported for hex values
73 INVALID-ALT-FORM-MSG2-NEXT: {{I}}NVALID-ALT-FORM2-NEXT: PREFIXED_DEC={{\[\[#%#d,PREFIXED_SIGN:\]\]}}
74 INVALID-ALT-FORM-MSG2-NEXT: {{^}} ^{{$}}
76 ; Numeric variable definition of hex value with missing 0x prefix.
77 RUN: FileCheck --check-prefix INVALID-HEX-PREFIX-DEF --input-file %s %s
79 FAIL DEF ALT FORM // INVALID-HEX-PREFIX-DEF-LABEL: FAIL DEF ALT FORM
80 INVALID_PREFIXED_LHEX: xf // INVALID-HEX-PREFIX-DEF-NOT: {{^}}INVALID_PREFIXED_LHEX: [[#%#x,INVALID_PREFIXED_LHEX:]]
81 INVALID_PREFIXED_UHEX: 0E // INVALID-HEX-PREFIX-DEF-NOT: {{^}}INVALID_PREFIXED_UHEX: [[#%#X,INVALID_PREFIXED_UHEX:]]
83 ; Numeric variable definition with precision specifier.
84 DEF PREC FMT // CHECK-LABEL: DEF PREC FMT
85 00000022 // CHECK-NEXT: {{^}}[[#%.8,PADDED_UNSI:]]
86 323232323 // CHECK-NEXT: {{^}}[[#%.8,PADDED_UNSI2:]]
87 00000018 // CHECK-NEXT: {{^}}[[#%.8u,PADDED_UNSI3:]]
88 181818181 // CHECK-NEXT: {{^}}[[#%.8u,PADDED_UNSI4:]]
89 0000000f // CHECK-NEXT: {{^}}[[#%.8x,PADDED_LHEX:]]
90 fffffffff // CHECK-NEXT: {{^}}[[#%.8x,PADDED_LHEX2:]]
91 0000000E // CHECK-NEXT: {{^}}[[#%.8X,PADDED_UHEX:]]
92 EEEEEEEEE // CHECK-NEXT: {{^}}[[#%.8X,PADDED_UHEX2:]]
93 -00000055 // CHECK-NEXT: {{^}}[[#%.8d,PADDED_SIGN:]]
94 -555555555 // CHECK-NEXT: {{^}}[[#%.8d,PADDED_SIGN2:]]
96 ; Numeric variable definition with precision specifier with value not padded
98 RUN: FileCheck --check-prefix INVALID-PADDING-DEF --input-file %s %s
100 FAIL DEF PREC FMT // INVALID-PADDING-DEF-LABEL: FAIL DEF PREC FMT
101 INVALID_PADDED_UNSI: 0000022 // INVALID-PADDING-DEF-NOT: {{^}}INVALID_PADDED_UNSI: [[#%.8,INVALID_PADDED_UNSI:]]
102 INVALID_PADDED_UNSI2: 0000018 // INVALID-PADDING-DEF-NOT: {{^}}INVALID_PADDED_UNSI2: [[#%.8u,INVALID_PADDED_UNSI2:]]
103 INVALID_PADDED_LHEX: 000000f // INVALID-PADDING-DEF-NOT: {{^}}INVALID_PADDED_LHEX: [[#%.8x,INVALID_PADDED_LHEX:]]
104 INVALID_PADDED_UHEX: 000000E // INVALID-PADDING-DEF-NOT: {{^}}INVALID_PADDED_UHEX: [[#%.8X,INVALID_PADDED_UHEX:]]
105 INVALID_PADDED_SIGN: -0000055 // INVALID-PADDING-DEF-NOT: {{^}}INVALID_PADDED_SIGN: [[#%.8d,INVALID_PADDED_SIGN:]]
107 ; Numeric expressions with explicit matching format and default matching rule
108 ; using variables defined on other lines without spaces.
109 USE EXPL FMT IMPL MATCH // CHECK-LABEL: USE EXPL FMT IMPL MATCH
110 11 // CHECK-NEXT: {{^}}[[#%u,UNSI]]
111 12 // CHECK-NEXT: {{^}}[[#%u,UNSI+1]]
112 10 // CHECK-NEXT: {{^}}[[#%u,UNSI-1]]
113 15 // CHECK-NEXT: {{^}}[[#%u,add(UNSI,4)]]
114 11 // CHECK-NEXT: {{^}}[[#%u,max(UNSI,7)]]
115 99 // CHECK-NEXT: {{^}}[[#%u,max(UNSI,99)]]
116 7 // CHECK-NEXT: {{^}}[[#%u,min(UNSI,7)]]
117 11 // CHECK-NEXT: {{^}}[[#%u,min(UNSI,99)]]
118 8 // CHECK-NEXT: {{^}}[[#%u,sub(UNSI,3)]]
119 c // CHECK-NEXT: {{^}}[[#%x,LHEX]]
120 d // CHECK-NEXT: {{^}}[[#%x,LHEX+1]]
121 b // CHECK-NEXT: {{^}}[[#%x,LHEX-1]]
122 1a // CHECK-NEXT: {{^}}[[#%x,LHEX+0xe]]
123 1a // CHECK-NEXT: {{^}}[[#%x,LHEX+0xE]]
124 e // CHECK-NEXT: {{^}}[[#%x,add(LHEX,2)]]
125 ff // CHECK-NEXT: {{^}}[[#%x,max(LHEX,0xff)]]
126 a // CHECK-NEXT: {{^}}[[#%x,min(LHEX,0xa)]]
127 a // CHECK-NEXT: {{^}}[[#%x,sub(LHEX,2)]]
128 D // CHECK-NEXT: {{^}}[[#%X,UHEX]]
129 E // CHECK-NEXT: {{^}}[[#%X,UHEX+1]]
130 C // CHECK-NEXT: {{^}}[[#%X,UHEX-1]]
131 1B // CHECK-NEXT: {{^}}[[#%X,UHEX+0xe]]
132 1B // CHECK-NEXT: {{^}}[[#%X,UHEX+0xE]]
133 F // CHECK-NEXT: {{^}}[[#%X,add(UHEX,2)]]
134 FF // CHECK-NEXT: {{^}}[[#%X,max(UHEX,0xff)]]
135 A // CHECK-NEXT: {{^}}[[#%X,min(UHEX,0xa)]]
136 B // CHECK-NEXT: {{^}}[[#%X,sub(UHEX,2)]]
137 -30 // CHECK-NEXT: {{^}}[[#%d,SIGN]]
138 -29 // CHECK-NEXT: {{^}}[[#%d,SIGN+1]]
139 -31 // CHECK-NEXT: {{^}}[[#%d,SIGN-1]]
140 42 // CHECK-NEXT: {{^}}[[#%d,SIGN+72]]
141 -29 // CHECK-NEXT: {{^}}[[#%d,add(SIGN,1)]]
142 -17 // CHECK-NEXT: {{^}}[[#%d,max(SIGN,-17)]]
143 -30 // CHECK-NEXT: {{^}}[[#%d,min(SIGN,-17)]]
144 -31 // CHECK-NEXT: {{^}}[[#%d,sub(SIGN,1)]]
145 11 // CHECK-NEXT: {{^}}[[#%u,UNSIa]]
146 11 // CHECK-NEXT: {{^}}[[#%u,UNSIb]]
147 11 // CHECK-NEXT: {{^}}[[#%u,UNSIc]]
148 c // CHECK-NEXT: {{^}}[[#%x,LHEXa]]
150 ; Numeric expressions with explicit matching format and default matching rule
151 ; using variables defined on other lines with different spacing.
152 USE EXPL FMT IMPL MATCH SPC // CHECK-LABEL: USE EXPL FMT IMPL MATCH SPC
153 11 // CHECK-NEXT: {{^}}[[#%u, UNSI]]
154 11 // CHECK-NEXT: {{^}}[[# %u, UNSI]]
155 11 // CHECK-NEXT: {{^}}[[# %u, UNSI ]]
156 12 // CHECK-NEXT: {{^}}[[#%u, UNSI+1]]
157 12 // CHECK-NEXT: {{^}}[[# %u, UNSI+1]]
158 12 // CHECK-NEXT: {{^}}[[# %u , UNSI+1]]
159 12 // CHECK-NEXT: {{^}}[[# %u , UNSI +1]]
160 12 // CHECK-NEXT: {{^}}[[# %u , UNSI + 1]]
161 12 // CHECK-NEXT: {{^}}[[# %u , UNSI + 1 ]]
162 10 // CHECK-NEXT: {{^}}[[#%u, UNSI-1]]
163 10 // CHECK-NEXT: {{^}}[[# %u, UNSI-1]]
164 10 // CHECK-NEXT: {{^}}[[# %u , UNSI-1]]
165 10 // CHECK-NEXT: {{^}}[[# %u , UNSI -1]]
166 10 // CHECK-NEXT: {{^}}[[# %u , UNSI - 1]]
167 10 // CHECK-NEXT: {{^}}[[# %u , UNSI - 1 ]]
168 13 // CHECK-NEXT: {{^}}[[#%u, add(UNSI,2)]]
169 13 // CHECK-NEXT: {{^}}[[# %u, add(UNSI,2)]]
170 13 // CHECK-NEXT: {{^}}[[# %u , add(UNSI,2)]]
171 13 // CHECK-NEXT: {{^}}[[# %u , add(UNSI, 2)]]
172 13 // CHECK-NEXT: {{^}}[[# %u , add( UNSI, 2)]]
173 13 // CHECK-NEXT: {{^}}[[# %u , add( UNSI,2)]]
174 13 // CHECK-NEXT: {{^}}[[# %u , add(UNSI,2) ]]
175 13 // CHECK-NEXT: {{^}}[[# %u , add (UNSI,2)]]
176 104 // CHECK-NEXT: {{^}}[[# %u , UNSI + sub( add (100 , UNSI+ 1 ), 20) +1 ]]
178 ; Numeric expressions with explicit matching format, precision, form and
179 ; default matching rule using variables defined on other lines without spaces.
180 USE EXPL FMT WITH PREC IMPL MATCH // CHECK-LABEL: USE EXPL FMT WITH PREC IMPL MATCH
181 11 // CHECK-NEXT: {{^}}[[#%.1u,UNSI]]
182 00000011 // CHECK-NEXT: {{^}}[[#%.8u,UNSI]]
183 1c // CHECK-NEXT: {{^}}[[#%.1x,LHEX+16]]
184 0x1c // CHECK-NEXT: {{^}}[[#%#.1x,LHEX+16]]
185 0000000c // CHECK-NEXT: {{^}}[[#%.8x,LHEX]]
186 0x0000000c // CHECK-NEXT: {{^}}[[#%#.8x,LHEX]]
187 1D // CHECK-NEXT: {{^}}[[#%.1X,UHEX+16]]
188 0x1D // CHECK-NEXT: {{^}}[[#%#.1X,UHEX+16]]
189 0000000D // CHECK-NEXT: {{^}}[[#%.8X,UHEX]]
190 0x0000000D // CHECK-NEXT: {{^}}[[#%#.8X,UHEX]]
191 -30 // CHECK-NEXT: {{^}}[[#%.1d,SIGN]]
192 -00000030 // CHECK-NEXT: {{^}}[[#%.8d,SIGN]]
194 ; Numeric expressions with explicit matching format, precision and wrong
195 ; padding, and default matching rule using variables defined on other lines
197 RUN: FileCheck --check-prefixes CHECK,INVALID-PADDING-EXPL-USE --input-file %s %s
199 FAIL USE IMPL FMT WITH PREC EXPL MATCH // INVALID-PADDING-EXPL-USE-LABEL: FAIL USE IMPL FMT WITH PREC IMPL MATCH
200 INVALID UNSI+1: 0000012 // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID UNSI+1: [[#%.8u,UNSI+1]]
201 INVALID UNSI-1: 000000010 // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID UNSI-1: [[#%.8u,UNSI-1]]
202 INVALID LHEX+1: 000000d // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID LHEX+1: [[#%.8x,LHEX+1]]
203 INVALID LHEX-1: 00000000b // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID LHEX-1: [[#%.8x,LHEX-1]]
204 INVALID UHEX+1: 000000E // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID UHEX+1: [[#%.8X,UHEX+1]]
205 INVALID UHEX-1: 00000000C // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID UHEX-1: [[#%.8X,UHEX-1]]
206 INVALID SIGN+1: -0000029 // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID SIGN+1: [[#%.8d,SIGN+1]]
207 INVALID SIGN-1: -000000031 // INVALID-PADDING-EXPL-USE-NOT: {{^}}INVALID SIGN-1: [[#%.8d,SIGN-1]]
209 ; Numeric expressions with implicit matching format and default matching rule
210 ; using variables defined on other lines.
211 USE IMPL FMT IMPL MATCH // CHECK-LABEL: USE IMPL FMT IMPL MATCH
212 11 // CHECK-NEXT: {{^}}[[#UNSI]]
213 12 // CHECK-NEXT: {{^}}[[#UNSI+1]]
214 10 // CHECK-NEXT: {{^}}[[#UNSI-1]]
215 99 // CHECK-NEXT: {{^}}[[#max(UNSI,99)]]
216 7 // CHECK-NEXT: {{^}}[[#min(UNSI,7)]]
217 c // CHECK-NEXT: {{^}}[[#LHEX]]
218 d // CHECK-NEXT: {{^}}[[#LHEX+1]]
219 b // CHECK-NEXT: {{^}}[[#LHEX-1]]
220 1a // CHECK-NEXT: {{^}}[[#LHEX+0xe]]
221 1a // CHECK-NEXT: {{^}}[[#LHEX+0xE]]
222 ff // CHECK-NEXT: {{^}}[[#max(LHEX,255)]]
223 a // CHECK-NEXT: {{^}}[[#min(LHEX,10)]]
224 D // CHECK-NEXT: {{^}}[[#UHEX]]
225 E // CHECK-NEXT: {{^}}[[#UHEX+1]]
226 C // CHECK-NEXT: {{^}}[[#UHEX-1]]
227 1B // CHECK-NEXT: {{^}}[[#UHEX+0xe]]
228 1B // CHECK-NEXT: {{^}}[[#UHEX+0xE]]
229 FF // CHECK-NEXT: {{^}}[[#max(UHEX,255)]]
230 A // CHECK-NEXT: {{^}}[[#min(UHEX,10)]]
231 -30 // CHECK-NEXT: {{^}}[[#SIGN]]
232 -29 // CHECK-NEXT: {{^}}[[#SIGN+1]]
233 -31 // CHECK-NEXT: {{^}}[[#SIGN-1]]
235 ; Numeric expressions with implicit matching format, precision, and default
236 ; matching rule using variables defined on other lines.
237 USE IMPL FMT WITH PREC IMPL MATCH // CHECK-LABEL: USE IMPL FMT WITH PREC IMPL MATCH
238 00000023 // CHECK-NEXT: {{^}}[[#PADDED_UNSI+1]]
239 323232324 // CHECK-NEXT: {{^}}[[#PADDED_UNSI2+1]]
240 00000019 // CHECK-NEXT: {{^}}[[#PADDED_UNSI3+1]]
241 181818182 // CHECK-NEXT: {{^}}[[#PADDED_UNSI4+1]]
242 00000010 // CHECK-NEXT: {{^}}[[#PADDED_LHEX+1]]
243 1000000000 // CHECK-NEXT: {{^}}[[#PADDED_LHEX2+1]]
244 0000000F // CHECK-NEXT: {{^}}[[#PADDED_UHEX+1]]
245 EEEEEEEEF // CHECK-NEXT: {{^}}[[#PADDED_UHEX2+1]]
246 -00000054 // CHECK-NEXT: {{^}}[[#PADDED_SIGN+1]]
247 -555555554 // CHECK-NEXT: {{^}}[[#PADDED_SIGN2+1]]
249 ; Numeric expression with implicit matching format, precision and wrong amount
250 ; of padding, and default matching rule using variables defined on other lines.
251 RUN: FileCheck --check-prefixes CHECK,INVALID-PADDING-IMPL-USE --input-file %s %s
253 FAIL USE IMPL FMT WITH PREC IMPL MATCH // INVALID-PADDING-IMPL-USE-LABEL: FAIL USE IMPL FMT WITH PREC IMPL MATCH
254 INVALID PADDED_UNSI+1: 0000023 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UNSI+1: [[#PADDED_UNSI+1]]
255 INVALID PADDED_UNSI-1: 000000021 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UNSI-1: [[#PADDED_UNSI-1]]
256 INVALID PADDED_UNSI3+1: 0000019 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UNSI3+1: [[#PADDED_UNSI3+1]]
257 INVALID PADDED_UNSI3-1: 000000017 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UNSI3-1: [[#PADDED_UNSI3-1]]
258 INVALID PADDED_LHEX+1: 0000010 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_LHEX+1: [[#PADDED_LHEX+1]]
259 INVALID PADDED_LHEX-1: 00000000e // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_LHEX-1: [[#PADDED_LHEX-1]]
260 INVALID PADDED_UHEX+1: 000000F // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UHEX+1: [[#PADDED_UHEX+1]]
261 INVALID PADDED_UHEX-1: 00000000D // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_UHEX-1: [[#PADDED_UHEX-1]]
262 INVALID PADDED_SIGN+1: -0000054 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_SIGN+1: [[#PADDED_SIGN+1]]
263 INVALID PADDED_SIGN-1: -000000056 // INVALID-PADDING-IMPL-USE-NOT: {{^}}INVALID PADDED_SIGN-1: [[#PADDED_SIGN-1]]
265 ; Numeric expressions using variables defined on other lines and an immediate
266 ; interpreted as an unsigned value.
267 ; Note: 9223372036854775819 = 0x8000000000000000 + 11
268 USE IMPL FMT IMPL MATCH UNSIGNED IMM
270 CHECK-LABEL: USE IMPL FMT IMPL MATCH UNSIGNED IMM
271 CHECK-NEXT: [[#UNSI+0x8000000000000000]]
273 ; Numeric expressions in default matching format and explicit matching rule using
274 ; variables defined on other lines.
275 USE DEF FMT EXPL MATCH // CHECK-LABEL: USE DEF FMT EXPL MATCH
276 11 // CHECK-NEXT: {{^}}[[#==UNSI]]
277 11 // CHECK-NEXT: {{^}}[[# == UNSI]]
278 12 // CHECK-NEXT: {{^}}[[#UNSI2: == UNSI + 1]]
279 12 // CHECK-NEXT: {{^}}[[#==UNSI2]]
281 ; Numeric expressions in default matching format and explicit matching rule using
282 ; variable defined on other lines with match failure.
283 RUN: %ProtectFileCheckOutput \
284 RUN: not FileCheck --check-prefix NUMEXPR-CONSTRAINT-NOMATCH --input-file %s %s 2>&1 \
285 RUN: | FileCheck --check-prefix NUMEXPR-CONSTRAINT-NOMATCH-MSG --strict-whitespace %s
287 USE DEF FMT EXPL NO MATCH
290 NUMEXPR-CONSTRAINT-NOMATCH-LABEL: USE DEF FMT EXPL NO MATCH
291 NUMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI=[[#UNSI:]]
292 NUMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI: [[#==UNSI]]
293 NUMEXPR-CONSTRAINT-NOMATCH-MSG: numeric-expression.txt:[[#@LINE-1]]:34: error: {{N}}UMEXPR-CONSTRAINT-NOMATCH-NEXT: expected string not found in input
294 NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT: {{N}}UMEXPR-CONSTRAINT-NOMATCH-NEXT: UNSI: {{\[\[#==UNSI\]\]}}
295 NUMEXPR-CONSTRAINT-NOMATCH-MSG-NEXT: {{^}} ^{{$}}
297 ; Empty numeric expression with matching constraint.
298 RUN: %ProtectFileCheckOutput \
299 RUN: not FileCheck --check-prefix EMPTY-NUMEXPR-CONSTRAINT --input-file %s %s 2>&1 \
300 RUN: | FileCheck --check-prefix EMPTY-NUMEXPR-CONSTRAINT-MSG --strict-whitespace %s
302 EMPTY NUMEXPR USE WITH CONSTRAINT
304 EMPTY-NUMEXPR-CONSTRAINT-LABEL: EMPTY NUMEXPR USE WITH CONSTRAINT
305 EMPTY-NUMEXPR-CONSTRAINT-NEXT: [[# ==]]
306 EMPTY-NUMEXPR-CONSTRAINT-MSG: numeric-expression.txt:[[#@LINE-1]]:38: error: empty numeric expression should not have a constraint
307 EMPTY-NUMEXPR-CONSTRAINT-MSG-NEXT: {{E}}MPTY-NUMEXPR-CONSTRAINT-NEXT: {{\[\[# ==\]\]}}
308 EMPTY-NUMEXPR-CONSTRAINT-MSG-NEXT: {{^}} ^{{$}}
310 ; Definition from empty numeric expression with matching constraint.
311 RUN: %ProtectFileCheckOutput \
312 RUN: not FileCheck --check-prefix EMPTY-NUMDEF-CONSTRAINT --input-file %s %s 2>&1 \
313 RUN: | FileCheck --check-prefix EMPTY-NUMDEF-CONSTRAINT-MSG %s
315 EMPTY NUMEXPR DEF WITH CONSTRAINT
317 EMPTY-NUMDEF-CONSTRAINT-LABEL: EMPTY NUMEXPR CONSTRAINT
318 EMPTY-NUMDEF-CONSTRAINT-NEXT: [[#VARDEF: ==]]
319 EMPTY-NUMDEF-CONSTRAINT-MSG: numeric-expression.txt:[[#@LINE-1]]:44: error: empty numeric expression should not have a constraint
320 EMPTY-NUMDEF-CONSTRAINT-MSG-NEXT: {{E}}MPTY-NUMDEF-CONSTRAINT-NEXT: {{\[\[#VARDEF: ==\]\]}}
321 EMPTY-NUMDEF-CONSTRAINT-MSG-NEXT: {{^}} ^{{$}}
323 ; Numeric expressions with matching format overriding the implicit format of
324 ; variables defined on other lines.
325 USE CONV FMT IMPL MATCH // CHECK-LABEL: USE CONV FMT IMPL MATCH
326 b // CHECK-NEXT: {{^}}[[# %x, UNSI]]
327 B // CHECK-NEXT: {{^}}[[# %X, UNSI]]
328 -1 // CHECK-NEXT: {{^}}[[# %d, UNSI-12]]
329 12 // CHECK-NEXT: {{^}}[[# %u, LHEX]]
330 C // CHECK-NEXT: {{^}}[[# %X, LHEX]]
331 -2 // CHECK-NEXT: {{^}}[[# %d, LHEX-14]]
332 13 // CHECK-NEXT: {{^}}[[# %u, UHEX]]
333 d // CHECK-NEXT: {{^}}[[# %x, UHEX]]
334 -5 // CHECK-NEXT: {{^}}[[# %d, UHEX-18]]
335 15 // CHECK-NEXT: {{^}}[[# %u, SIGN+45]]
336 f // CHECK-NEXT: {{^}}[[# %x, SIGN+45]]
337 F // CHECK-NEXT: {{^}}[[# %X, SIGN+45]]
339 ; Conflicting implicit format.
340 RUN: %ProtectFileCheckOutput \
341 RUN: not FileCheck --check-prefixes CHECK,FMT-CONFLICT1 --input-file %s %s 2>&1 \
342 RUN: | FileCheck --strict-whitespace --check-prefix FMT-CONFLICT1-MSG %s
343 RUN: %ProtectFileCheckOutput \
344 RUN: not FileCheck --check-prefixes CHECK,FMT-CONFLICT2 --input-file %s %s 2>&1 \
345 RUN: | FileCheck --strict-whitespace --check-prefix FMT-CONFLICT2-MSG %s
347 VAR USE IMPL FMT CONFLICT
349 FMT-CONFLICT1-LABEL: VAR USE IMPL FMT CONFLICT
350 FMT-CONFLICT1-NEXT: [[#UNSI + LHEX]]
351 FMT-CONFLICT1-MSG: numeric-expression.txt:[[#@LINE-1]]:24: error: implicit format conflict between 'UNSI' (%u) and 'LHEX' (%x), need an explicit format specifier
352 FMT-CONFLICT1-MSG-NEXT: {{F}}MT-CONFLICT1-NEXT: {{\[\[#UNSI \+ LHEX\]\]}}
353 FMT-CONFLICT1-MSG-NEXT: {{^ \^$}}
355 VAR USE IMPL FMT CONFLICT COMPLEX
357 FMT-CONFLICT2-LABEL: VAR USE IMPL FMT CONFLICT
358 FMT-CONFLICT2-NEXT: [[#UNSI + UNSIa + LHEX]]
359 FMT-CONFLICT2-MSG: numeric-expression.txt:[[#@LINE-1]]:24: error: implicit format conflict between 'UNSI + UNSIa' (%u) and 'LHEX' (%x), need an explicit format specifier
360 FMT-CONFLICT2-MSG-NEXT: {{F}}MT-CONFLICT2-NEXT: {{\[\[#UNSI \+ UNSIa \+ LHEX\]\]}}
361 FMT-CONFLICT2-MSG-NEXT: {{^ \^$}}
363 ; Explicitly specified format can override conflicting implicit formats.
364 VAR USE IMPL OVERRIDE FMT CONFLICT // CHECK-LABEL: VAR USE IMPL OVERRIDE FMT CONFLICT
365 23 // CHECK-NEXT: {{^}}[[# %u, UNSI + LHEX]]
367 ; Numeric expressions using more than one variable defined on other lines.
368 USE MULTI VAR // CHECK-LABEL: USE MULTI VAR
369 22 // CHECK-NEXT: {{^}}[[#UNSI+UNSIa]]
371 ; Numeric expression using a variable defined from a numeric expression.
372 DEF EXPR GOOD MATCH // CHECK-LABEL: DEF EXPR GOOD MATCH
373 42 // CHECK-NEXT: {{^}}[[# VAR42:UNSI+31]]
374 41 // CHECK-NEXT: {{^}}[[# VAR42-1]]
376 ; Empty numeric expression.
377 EMPTY NUM EXPR // CHECK-LABEL: EMPTY NUM EXPR
378 foo 104 bar // CHECK-NEXT: {{^}}foo [[#]] bar
380 ; Numeric expressions using parentheses.
381 RUN: %ProtectFileCheckOutput \
382 RUN: not FileCheck -D#NUMVAR=10 --check-prefix PAREN-OP \
383 RUN: --input-file %s %s 2>&1 \
384 RUN: | FileCheck --strict-whitespace --check-prefix PAREN-OP-MSG %s
386 PAREN EXPRESSIONS // PAREN-OP-LABEL: PAREN EXPRESSIONS
387 11 // PAREN-OP-NEXT: [[#(NUMVAR+2)-1]]
388 11 // PAREN-OP-NEXT: [[#NUMVAR+(2-1)]]
389 11 // PAREN-OP-NEXT: [[#NUMVAR+(2-1]]
390 PAREN-OP-MSG: numeric-expression.txt:[[#@LINE-1]]:36: error: missing ')' at end of nested expression
391 PAREN-OP-MSG-NEXT: {{P}}AREN-OP-NEXT: {{\[\[#NUMVAR\+\(2\-1]\]}}
392 PAREN-OP-MSG-NEXT: {{^}} ^{{$}}
394 ; Numeric expression using undefined variables.
395 RUN: %ProtectFileCheckOutput \
396 RUN: not FileCheck --check-prefix UNDEF-USE --input-file %s %s 2>&1 \
397 RUN: | FileCheck --strict-whitespace --check-prefix UNDEF-USE-MSG %s
401 UNDEF-USE-LABEL: UNDEF VAR USE
402 UNDEF-USE-NEXT: UNDEFVAR: [[#UNDEFVAR1+UNDEFVAR2]]
403 UNDEF-USE-MSG: numeric-expression.txt:[[#@LINE-1]]:30: error: undefined variable: UNDEFVAR1
404 UNDEF-USE-MSG-NEXT: {{U}}NDEF-USE-NEXT: {{U}}NDEFVAR: {{\[\[#UNDEFVAR1\+UNDEFVAR2\]\]}}
405 UNDEF-USE-MSG-NEXT: {{^}} ^{{$}}
406 UNDEF-USE-MSG-NEXT: numeric-expression.txt:[[#@LINE-4]]:40: error: undefined variable: UNDEFVAR2
407 UNDEF-USE-MSG-NEXT: {{U}}NDEF-USE-NEXT: {{U}}NDEFVAR: {{\[\[#UNDEFVAR1\+UNDEFVAR2\]\]}}
408 UNDEF-USE-MSG-NEXT: {{^}} ^{{$}}
410 ; Numeric expression in negative directive using undefined variables.
411 RUN: %ProtectFileCheckOutput \
412 RUN: not FileCheck --check-prefix UNDEF-USE2 --input-file %s %s 2>&1 \
413 RUN: | FileCheck --strict-whitespace --check-prefix UNDEF-USE-MSG2 %s
415 CHECK NOT UNDEF VAR USE
417 UNDEF-USE2-LABEL: CHECK NOT UNDEF VAR USE
418 UNDEF-USE2-NOT: UNDEFVAR: [[#UNDEFVAR1+UNDEFVAR2]]
419 UNDEF-USE2: END MARKER
420 UNDEF-USE-MSG2: numeric-expression.txt:[[#@LINE-2]]:30: error: undefined variable: UNDEFVAR1
421 UNDEF-USE-MSG2-NEXT: {{U}}NDEF-USE2-NOT: {{U}}NDEFVAR: {{\[\[#UNDEFVAR1\+UNDEFVAR2\]\]}}
422 UNDEF-USE-MSG2-NEXT: {{^}} ^{{$}}
423 UNDEF-USE-MSG2-NEXT: numeric-expression.txt:[[#@LINE-5]]:40: error: undefined variable: UNDEFVAR2
424 UNDEF-USE-MSG2-NEXT: {{U}}NDEF-USE2-NOT: {{U}}NDEFVAR: {{\[\[#UNDEFVAR1\+UNDEFVAR2\]\]}}
425 UNDEF-USE-MSG2-NEXT: {{^}} ^{{$}}
427 ; Numeric expression with unsupported operator.
428 RUN: %ProtectFileCheckOutput \
429 RUN: not FileCheck -D#NUMVAR=10 --check-prefix INVAL-OP \
430 RUN: --input-file %s %s 2>&1 \
431 RUN: | FileCheck --strict-whitespace --check-prefix INVAL-OP-MSG %s
435 INVAL-OP-LABEL: INVALID OPERATOR
436 INVAL-OP-NEXT: NUMVAR*2: [[#NUMVAR*2]]
437 INVAL-OP-MSG: numeric-expression.txt:[[#@LINE-1]]:35: error: unsupported operation '*'
438 INVAL-OP-MSG-NEXT: {{I}}NVAL-OP-NEXT: NUMVAR*2: {{\[\[#NUMVAR\*2\]\]}}
439 INVAL-OP-MSG-NEXT: {{^}} ^{{$}}
441 ; Name conflict between Numeric variable definition and string variable
442 ; definition whether from the command-line or input text.
443 RUN: %ProtectFileCheckOutput \
444 RUN: not FileCheck --check-prefixes CONFLICT,CONFLICT1,CONFLICT2 \
445 RUN: --input-file %s %s 2>&1 \
446 RUN: | FileCheck --strict-whitespace --check-prefix INPUT-STR-CONFLICT %s
447 RUN: %ProtectFileCheckOutput \
448 RUN: not FileCheck -D#NUMVAR=42 --check-prefixes CONFLICT,CONFLICT2 \
449 RUN: --input-file %s %s 2>&1 \
450 RUN: | FileCheck --strict-whitespace --check-prefix INPUT-STR-CONFLICT %s
451 RUN: %ProtectFileCheckOutput \
452 RUN: not FileCheck -D#NUMVAR=42 -DNUMVAR=foobar --check-prefix CONFLICT \
453 RUN: --input-file %s %s 2>&1 \
454 RUN: | FileCheck --strict-whitespace --check-prefix CLI-STR-CONFLICT %s
455 RUN: %ProtectFileCheckOutput \
456 RUN: not FileCheck --check-prefixes CONFLICT,CONFLICT3,CONFLICT4 \
457 RUN: --input-file %s %s 2>&1 \
458 RUN: | FileCheck --strict-whitespace --check-prefix INPUT-NUM-CONFLICT %s
459 RUN: %ProtectFileCheckOutput \
460 RUN: not FileCheck -DSTRVAR=foobar --check-prefixes CONFLICT,CONFLICT4 \
461 RUN: --input-file %s %s 2>&1 \
462 RUN: | FileCheck --strict-whitespace --check-prefix INPUT-NUM-CONFLICT %s
463 RUN: %ProtectFileCheckOutput \
464 RUN: not FileCheck -DSTRVAR=foobar -D#STRVAR=42 --check-prefix CONFLICT \
465 RUN: --input-file %s %s 2>&1 \
466 RUN: | FileCheck --strict-whitespace --check-prefix CLI-NUM-CONFLICT %s
468 STRVAR NUMVAR CONFLICT
472 CONFLICT-LABEL: STRVAR NUMVAR CONFLICT
473 CONFLICT1-NEXT: redef1 [[#NUMVAR:]]
474 CONFLICT2: [[NUMVAR:foo.*]]
475 CONFLICT3: [[STRVAR:foo.*]]
476 CONFLICT4: redef2 [[#STRVAR:]]
477 INPUT-STR-CONFLICT: numeric-expression.txt:[[#@LINE-3]]:14: error: numeric variable with name 'NUMVAR' already exists
478 INPUT-STR-CONFLICT-NEXT: {{C}}ONFLICT2: {{\[\[NUMVAR:foo\.\*\]\]}}
479 INPUT-STR-CONFLICT-NEXT: {{^}} ^{{$}}
480 CLI-STR-CONFLICT: Global defines:2:19: error: numeric variable with name 'NUMVAR' already exists
481 CLI-STR-CONFLICT-NEXT: Global define #2: NUMVAR=foobar
482 CLI-STR-CONFLICT-NEXT: {{^}} ^{{$}}
483 INPUT-NUM-CONFLICT: numeric-expression.txt:[[#@LINE-7]]:22: error: string variable with name 'STRVAR' already exists
484 INPUT-NUM-CONFLICT-NEXT: CONFLICT4: redef2 {{\[\[#STRVAR:\]\]}}
485 INPUT-NUM-CONFLICT-NEXT: {{^}} ^{{$}}
486 CLI-NUM-CONFLICT: Global defines:2:45: error: string variable with name 'STRVAR' already exists
487 CLI-NUM-CONFLICT-NEXT: Global define #2: #STRVAR=42 (parsed as: {{\[\[#STRVAR:42\]\]}})
488 CLI-NUM-CONFLICT-NEXT: {{^}} ^{{$}}
490 ; Numeric variable definition with too big value.
491 RUN: %ProtectFileCheckOutput \
492 RUN: not FileCheck --check-prefix BIGVAL --input-file %s %s 2>&1 \
493 RUN: | FileCheck --strict-whitespace --check-prefix BIGVAL-MSG %s
496 NUMVAR: 10000000000000000000000
497 BIGVAL-LABEL: BIG VALUE
498 BIGVAL-NEXT: NUMVAR: [[#NUMVAR:]]
499 BIGVAL-MSG: numeric-expression.txt:[[#@LINE-3]]:9: error: unable to represent numeric value
500 BIGVAL-MSG-NEXT: {{N}}UMVAR: 10000000000000000000000
501 BIGVAL-MSG-NEXT: {{^}} ^{{$}}
503 ; Verify that when a variable is set to an expression the expression is still
505 RUN: %ProtectFileCheckOutput \
506 RUN: not FileCheck --check-prefix DEF-EXPR-FAIL --input-file %s %s 2>&1 \
507 RUN: | FileCheck --strict-whitespace --check-prefix DEF-EXPR-FAIL-MSG %s
512 DEF-EXPR-FAIL-LABEL: DEF EXPR WRONG MATCH
513 DEF-EXPR-FAIL-NEXT: [[# VAR20:]]
514 DEF-EXPR-FAIL-NEXT: [[# VAR42: VAR20+22]]
515 DEF-EXPR-FAIL-MSG: numeric-expression.txt:[[#@LINE-1]]:21: error: {{D}}EF-EXPR-FAIL-NEXT: is not on the line after the previous match
516 DEF-EXPR-FAIL-MSG-NEXT: {{D}}EF-EXPR-FAIL-NEXT: {{\[\[# VAR42: VAR20\+22\]\]}}
517 DEF-EXPR-FAIL-MSG-NEXT: {{^}} ^{{$}}
519 ; Verify that using a numeric variable defined on the same line (whether from
520 ; input or from an expression) is rejected.
521 RUN: %ProtectFileCheckOutput \
522 RUN: not FileCheck --check-prefix SAME-LINE-USE1 --input-file %s %s 2>&1 \
523 RUN: | FileCheck --strict-whitespace --check-prefix SAME-LINE-USE-MSG1 %s
524 RUN: %ProtectFileCheckOutput \
525 RUN: not FileCheck --check-prefix SAME-LINE-USE2 --input-file %s %s 2>&1 \
526 RUN: | FileCheck --strict-whitespace --check-prefix SAME-LINE-USE-MSG2 %s
531 SAME-LINE-USE1-LABEL: SAME LINE USE
532 SAME-LINE-USE1-NEXT: [[#]]
533 SAME-LINE-USE1-NEXT: [[#UNSI:]] [[#UNSI+1]]
534 SAME-LINE-USE-MSG1: numeric-expression.txt:[[#@LINE-1]]:36: error: numeric variable 'UNSI' defined earlier in the same CHECK directive
535 SAME-LINE-USE-MSG1-NEXT: {{S}}AME-LINE-USE1-NEXT: {{\[\[#UNSI:\]\] \[\[#UNSI\+1\]\]}}
536 SAME-LINE-USE-MSG1-NEXT: {{^}} ^{{$}}
538 SAME-LINE-USE2-LABEL: SAME LINE USE
539 SAME-LINE-USE2-NEXT: [[#UNSI:]]
540 SAME-LINE-USE2-NEXT: [[#UNSI2:UNSI+1]] [[#UNSI2+1]]
541 SAME-LINE-USE-MSG2: numeric-expression.txt:[[#@LINE-1]]:43: error: numeric variable 'UNSI2' defined earlier in the same CHECK directive
542 SAME-LINE-USE-MSG2-NEXT: {{S}}AME-LINE-USE2-NEXT: {{\[\[#UNSI2:UNSI\+1\]\] \[\[#UNSI2\+1\]\]}}
543 SAME-LINE-USE-MSG2-NEXT: {{^}} ^{{$}}
545 ; Invalid change of format in variable redefinition.
546 RUN: %ProtectFileCheckOutput \
547 RUN: not FileCheck --check-prefix REDEF-NEW-FMT --input-file %s %s 2>&1 \
548 RUN: | FileCheck --strict-whitespace --check-prefix REDEF-NEW-FMT-MSG %s
553 REDEF-NEW-FMT-LABEL: VAR REDEF FMT CHANGE
554 REDEF-NEW-FMT-NEXT: [[#UNSI:]]
555 REDEF-NEW-FMT-NEXT: [[#%X,UNSI:]]
556 REDEF-NEW-FMT-MSG: numeric-expression.txt:[[#@LINE-1]]:31: error: format different from previous variable definition
557 REDEF-NEW-FMT-MSG-NEXT: {{R}}EDEF-NEW-FMT-NEXT: {{\[\[#%X,UNSI:\]\]}}
558 REDEF-NEW-FMT-MSG-NEXT: {{^}} ^{{$}}
560 ; Numeric expression with overflow.
561 RUN: %ProtectFileCheckOutput \
562 RUN: not FileCheck --check-prefix OVERFLOW --input-file %s %s 2>&1 \
563 RUN: | FileCheck --check-prefix OVERFLOW-MSG --strict-whitespace %s
566 BIGVAR=10000000000000000
567 OVERFLOW-LABEL: OVERFLOW
568 OVERFLOW-NEXT: BIGVAR: [[#BIGVAR:0x8000000000000000+0x8000000000000000]]
569 OVERFLOW-MSG: numeric-expression.txt:[[#@LINE-1]]:27: error: unable to substitute variable or numeric expression
570 OVERFLOW-MSG-NEXT: {{O}}VERFLOW-NEXT: BIGVAR: {{\[\[#BIGVAR:0x8000000000000000\+0x8000000000000000\]\]}}
571 OVERFLOW-MSG-NEXT: {{^}} ^{{$}}
573 ; Numeric expression with underflow.
574 RUN: %ProtectFileCheckOutput \
575 RUN: not FileCheck --check-prefix UNDERFLOW --input-file %s %s 2>&1 \
576 RUN: | FileCheck --check-prefix UNDERFLOW-MSG --strict-whitespace %s
579 TINYVAR=-10000000000000000
580 UNDERFLOW-LABEL: UNDERFLOW
581 UNDERFLOW-NEXT: TINYVAR: [[#%d,TINYVAR:-0x8000000000000000-0x8000000000000000]]
582 UNDERFLOW-MSG: numeric-expression.txt:[[#@LINE-1]]:29: error: unable to substitute variable or numeric expression
583 UNDERFLOW-MSG-NEXT: {{U}}NDERFLOW-NEXT: TINYVAR: {{\[\[#%d,TINYVAR:-0x8000000000000000-0x8000000000000000\]\]}}
584 UNDERFLOW-MSG-NEXT: {{^}} ^{{$}}
586 RUN: %ProtectFileCheckOutput \
587 RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-MISSING-CLOSING-BRACKET --input-file %s %s 2>&1 \
588 RUN: | FileCheck --strict-whitespace --check-prefix CALL-MISSING-CLOSING-BRACKET-MSG %s
590 CALL MISSING CLOSING BRACKET
592 CALL-MISSING-CLOSING-BRACKET-LABEL: CALL MISSING CLOSING BRACKET
593 CALL-MISSING-CLOSING-BRACKET-NEXT: [[#add(NUMVAR,3]]
594 CALL-MISSING-CLOSING-BRACKET-MSG: numeric-expression.txt:[[#@LINE-1]]:51: error: missing ')' at end of call expression
595 CALL-MISSING-CLOSING-BRACKET-MSG-NEXT: {{C}}ALL-MISSING-CLOSING-BRACKET-NEXT: {{\[\[#add\(NUMVAR,3\]\]}}
596 CALL-MISSING-CLOSING-BRACKET-MSG-NEXT: {{^}} ^{{$}}
598 RUN: %ProtectFileCheckOutput \
599 RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-MISSING-ARGUMENT --input-file %s %s 2>&1 \
600 RUN: | FileCheck --strict-whitespace --check-prefix CALL-MISSING-ARGUMENT-MSG %s
602 CALL MISSING ARGUMENT
604 CALL-MISSING-ARGUMENT-LABEL: CALL MISSING ARGUMENT
605 CALL-MISSING-ARGUMENT-NEXT: [[#add(NUMVAR,)]]
606 CALL-MISSING-ARGUMENT-MSG: numeric-expression.txt:[[#@LINE-1]]:43: error: missing argument
607 CALL-MISSING-ARGUMENT-MSG-NEXT: {{C}}ALL-MISSING-ARGUMENT-NEXT: {{\[\[#add\(NUMVAR,\)\]\]}}
608 CALL-MISSING-ARGUMENT-MSG-NEXT: {{^}} ^{{$}}
610 RUN: %ProtectFileCheckOutput \
611 RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-WRONG-ARGUMENT-COUNT --input-file %s %s 2>&1 \
612 RUN: | FileCheck --strict-whitespace --check-prefix CALL-WRONG-ARGUMENT-COUNT-MSG %s
614 CALL WRONG ARGUMENT COUNT
616 CALL-WRONG-ARGUMENT-COUNT-LABEL: CALL WRONG ARGUMENT COUNT
617 CALL-WRONG-ARGUMENT-COUNT-NEXT: [[#add(NUMVAR)]]
618 CALL-WRONG-ARGUMENT-COUNT-MSG: numeric-expression.txt:[[#@LINE-1]]:36: error: function 'add' takes 2 arguments but 1 given
619 CALL-WRONG-ARGUMENT-COUNT-MSG-NEXT: {{C}}ALL-WRONG-ARGUMENT-COUNT-NEXT: {{\[\[#add\(NUMVAR\)\]\]}}
620 CALL-WRONG-ARGUMENT-COUNT-MSG-NEXT: {{^}} ^{{$}}
622 RUN: %ProtectFileCheckOutput \
623 RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-UNDEFINED-FUNCTION --input-file %s %s 2>&1 \
624 RUN: | FileCheck --strict-whitespace --check-prefix CALL-UNDEFINED-FUNCTION-MSG %s
626 CALL UNDEFINED FUNCTION
628 CALL-UNDEFINED-FUNCTION-LABEL: CALL UNDEFINED FUNCTION
629 CALL-UNDEFINED-FUNCTION-NEXT: [[#bogus_function(NUMVAR)]]
630 CALL-UNDEFINED-FUNCTION-MSG: numeric-expression.txt:[[#@LINE-1]]:34: error: call to undefined function 'bogus_function'
631 CALL-UNDEFINED-FUNCTION-MSG-NEXT: {{C}}ALL-UNDEFINED-FUNCTION-NEXT: {{\[\[#bogus_function\(NUMVAR\)\]\]}}
632 CALL-UNDEFINED-FUNCTION-MSG-NEXT: {{^}} ^{{$}}