Skip to content

Commit 24d10d3

Browse files
committed
filecheck: fix self tests for "forbid prefixes end with directive name"
1 parent a056ef7 commit 24d10d3

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

llvm/test/FileCheck/comment/bad-comment-prefix.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Check empty comment prefix.
44
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
55
RUN: -comment-prefixes= | \
6-
RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
6+
RUN: FileCheck -check-prefix=EMPTY-PREFIX %s
77
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
88
RUN: -comment-prefixes=,FOO | \
9-
RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
9+
RUN: FileCheck -check-prefix=EMPTY-PREFIX %s
1010
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
1111
RUN: -comment-prefixes=FOO, | \
12-
RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
12+
RUN: FileCheck -check-prefix=EMPTY-PREFIX %s
1313
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
1414
RUN: -comment-prefixes=FOO,,BAR | \
15-
RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
16-
PREFIX-EMPTY: error: supplied comment prefix must not be the empty string
15+
RUN: FileCheck -check-prefix=EMPTY-PREFIX %s
16+
EMPTY-PREFIX: error: supplied comment prefix must not be the empty string
1717

1818
# Check invalid characters in comment prefix.
1919
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \

llvm/test/FileCheck/comment/suffixes.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Comment prefixes plus check directive suffixes are not comment directives
2-
# and are treated as plain text.
1+
# Comment prefixes plus check directive suffixes are forbidden.
2+
# FIXME: currently not verified bq ValidatePrefixes missing defaulted comment prefixes?
33

44
RUN: echo foo > %t.in
55
RUN: echo bar >> %t.in
@@ -12,11 +12,11 @@ RUN: FileCheck -check-prefix=CHECK1 %s
1212
CHECK1: .chk:1:18: remark: CHECK: expected string found in input
1313
CHECK1: .chk:2:17: remark: CHECK: expected string found in input
1414

15-
# But we can define them as comment prefixes.
15+
# But we can define them as comment prefixes; still forbidden.
1616

1717
RUN: %ProtectFileCheckOutput \
1818
RUN: FileCheck -dump-input=never -vv -comment-prefixes=COM,RUN,RUN-NOT %t.chk < %t.in 2>&1 | \
1919
RUN: FileCheck -check-prefix=CHECK2 %s
2020

21-
CHECK2: .chk:1:18: remark: CHECK: expected string found in input
21+
CHECK2: error: supplied comment prefix must not end with directive: '-NOT', prefix: 'RUN-NOT'
2222
CHECK2-NOT: .chk:2

llvm/test/FileCheck/numeric-expression.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -593,16 +593,16 @@ CALL-MISSING-ARGUMENT-MSG-NEXT: {{C}}ALL-MISSING-ARGUMENT-NEXT: {{\[\[#add\(NUMV
593593
CALL-MISSING-ARGUMENT-MSG-NEXT: {{^}} ^{{$}}
594594

595595
RUN: %ProtectFileCheckOutput \
596-
RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-WRONG-ARGUMENT-COUNT --input-file %s %s 2>&1 \
597-
RUN: | FileCheck --strict-whitespace --check-prefix CALL-WRONG-ARGUMENT-COUNT-MSG %s
596+
RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-WRONG-ARGUMENT-NUM --input-file %s %s 2>&1 \
597+
RUN: | FileCheck --strict-whitespace --check-prefix CALL-WRONG-ARGUMENT-NUM-MSG %s
598598

599-
CALL WRONG ARGUMENT COUNT
599+
CALL WRONG ARGUMENT NUM
600600
30
601-
CALL-WRONG-ARGUMENT-COUNT-LABEL: CALL WRONG ARGUMENT COUNT
602-
CALL-WRONG-ARGUMENT-COUNT-NEXT: [[#add(NUMVAR)]]
603-
CALL-WRONG-ARGUMENT-COUNT-MSG: numeric-expression.txt:[[#@LINE-1]]:36: error: function 'add' takes 2 arguments but 1 given
604-
CALL-WRONG-ARGUMENT-COUNT-MSG-NEXT: {{C}}ALL-WRONG-ARGUMENT-COUNT-NEXT: {{\[\[#add\(NUMVAR\)\]\]}}
605-
CALL-WRONG-ARGUMENT-COUNT-MSG-NEXT: {{^}} ^{{$}}
601+
CALL-WRONG-ARGUMENT-NUM-LABEL: CALL WRONG ARGUMENT NUM
602+
CALL-WRONG-ARGUMENT-NUM-NEXT: [[#add(NUMVAR)]]
603+
CALL-WRONG-ARGUMENT-NUM-MSG: numeric-expression.txt:[[#@LINE-1]]:34: error: function 'add' takes 2 arguments but 1 given
604+
CALL-WRONG-ARGUMENT-NUM-MSG-NEXT: {{C}}ALL-WRONG-ARGUMENT-NUM-NEXT: {{\[\[#add\(NUMVAR\)\]\]}}
605+
CALL-WRONG-ARGUMENT-NUM-MSG-NEXT: {{^}} ^{{$}}
606606

607607
RUN: %ProtectFileCheckOutput \
608608
RUN: not FileCheck -D#NUMVAR=10 --check-prefix CALL-UNDEFINED-FUNCTION --input-file %s %s 2>&1 \

0 commit comments

Comments
 (0)