1 # Bad comment prefixes are diagnosed.
3 # Check empty comment prefix.
4 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
5 RUN: -comment-prefixes= | \
6 RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
7 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
8 RUN: -comment-prefixes=,FOO | \
9 RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
10 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
11 RUN: -comment-prefixes=FOO, | \
12 RUN: FileCheck -check-prefix=PREFIX-EMPTY %s
13 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
14 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
18 # Check invalid characters in comment prefix.
19 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
20 RUN: -comment-prefixes=. | \
21 RUN: FileCheck -check-prefix=PREFIX-BAD-CHAR1 %s
22 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
23 RUN: -comment-prefixes='foo ' | \
24 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 '
28 # Check duplicate comment prefixes.
29 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
30 RUN: -comment-prefixes=FOO,BAR,BAZ,BAR | \
31 RUN: FileCheck -check-prefix=COMMENT-PREFIX-DUP %s
32 COMMENT-PREFIX-DUP: error: supplied comment prefix must be unique among check and comment prefixes: 'BAR'
34 # Check user-supplied check prefix that duplicates a default comment prefix.
35 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
36 RUN: -check-prefixes=FOO,COM | \
37 RUN: FileCheck -check-prefix=CHECK-PREFIX-DUP-COM %s
38 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
39 RUN: -check-prefixes=RUN,FOO | \
40 RUN: FileCheck -check-prefix=CHECK-PREFIX-DUP-RUN_ %s
41 CHECK-PREFIX-DUP-COM: error: supplied check prefix must be unique among check and comment prefixes: 'COM'
42 CHECK-PREFIX-DUP-RUN_: error: supplied check prefix must be unique among check and comment prefixes: 'RUN'
44 # Check user-supplied comment prefix that duplicates default check prefixes.
45 RUN: %ProtectFileCheckOutput not FileCheck /dev/null < /dev/null 2>&1 \
46 RUN: -comment-prefixes=CHECK | \
47 RUN: FileCheck -check-prefix=COMMENT-PREFIX-DUP-CHECK %s
48 COMMENT-PREFIX-DUP-CHECK: error: supplied comment prefix must be unique among check and comment prefixes: 'CHECK'