Skip to content

Commit 753c463

Browse files
committed
[FileCheck][NFC] Pre-commit test for printing escaped variables
1 parent 8b3e345 commit 753c463

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/FileCheck/var-escape.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; RUN: echo -e "WINPATH=A:\windows\style\path" > %t
2+
; RUN: echo -e "NOT_ESCAPED=shouldn't be escaped [a-Z]\+$" >> %t
3+
; RUN: echo -e 'ESCAPED=\\ needs\to "be" escaped\000' >> %t
4+
5+
VARS: WINPATH=[[WINPATH:.*]]
6+
VARS: NOT_ESCAPED=[[NOT_ESCAPED:.*]]
7+
VARS-NEXT: ESCAPED=[[ESCAPED:.*]]
8+
; Trigger a failed match, to show variables values
9+
VARS-NEXT: [[WINPATH]] [[NOT_ESCAPED]] [[ESCAPED]]
10+
11+
; RUN: %ProtectFileCheckOutput not FileCheck \
12+
; RUN: -dump-input=never --strict-whitespace --check-prefix=VARS --input-file=%t %s 2>&1 \
13+
; RUN: | FileCheck %s
14+
15+
CHECK: with "WINPATH" equal to "A:\\\\windows\\\\style\\\\path"
16+
CHECK: with "NOT_ESCAPED" equal to "shouldn't be escaped \\[a-Z\\]\\\\\\+\\$"
17+
CHECK: with "ESCAPED" equal to "\\\\ needs\to \"be\" escaped\\\000"

0 commit comments

Comments
 (0)