Skip to content

Commit 16ee61b

Browse files
committed
filecheck: fix self tests for "forbid prefixes end with directive name"
1 parent 512b5a7 commit 16ee61b

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

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

Lines changed: 7 additions & 7 deletions
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 \
@@ -22,8 +22,8 @@ RUN: FileCheck -check-prefix=PREFIX-BAD-CHAR1 %s
2222
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
2323
RUN: -comment-prefixes='foo ' | \
2424
RUN: FileCheck -check-prefix=PREFIX-BAD-CHAR2 %s
25-
PREFIX-BAD-CHAR1: error: supplied comment prefix must start with a letter and contain only alphanumeric characters, hyphens, and underscores: '.'
26-
PREFIX-BAD-CHAR2: error: supplied comment prefix must start with a letter and contain only alphanumeric characters, hyphens, and underscores: 'foo '
25+
PREFIX-BAD-CHAR1: error: supplied comment prefix must start with a letter or digit and contain only ascii alphanumeric characters, hyphens, and underscores: '.'
26+
PREFIX-BAD-CHAR2: error: supplied comment prefix must start with a letter or digit and contain only ascii alphanumeric characters, hyphens, and underscores: 'foo '
2727

2828
# Check duplicate comment prefixes.
2929
RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \

llvm/test/FileCheck/comment/suffixes.txt

Lines changed: 4 additions & 4 deletions
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

Lines changed: 8 additions & 8 deletions
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 \

llvm/test/FileCheck/validate-check-prefix.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
foobar
77
; A1a-B_c: foobar
88

9-
; BAD_PREFIX: supplied check prefix must start with a letter and contain only alphanumeric characters, hyphens, and underscores: 'A!'
9+
; BAD_PREFIX: supplied check prefix must start with a letter or digit and contain only ascii alphanumeric characters, hyphens, and underscores: 'A!'
1010

1111
; DUPLICATE_PREFIX: error: supplied check prefix must be unique among check and comment prefixes: 'REPEAT'
1212

0 commit comments

Comments
 (0)