2 ; Basic error checking.
7 ; RUN: %ProtectFileCheckOutput \
8 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR1 2>&1 \
9 ; RUN: | FileCheck %s --check-prefix=ERRCOUNT1
10 CHECK-ERR1-COUNT-xx: this
11 ERRCOUNT1: [[@LINE-1]]:18: error: invalid count in -COUNT specification on prefix 'CHECK-ERR1'
13 ; RUN: %ProtectFileCheckOutput \
14 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR2 2>&1 \
15 ; RUN: | FileCheck %s --check-prefix=ERRCOUNT2
16 CHECK-ERR2-COUNT-0x1: something
17 ERRCOUNT2: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR2'
19 ; RUN: %ProtectFileCheckOutput \
20 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR3 2>&1 \
21 ; RUN: | FileCheck %s --check-prefix=ERRCOUNT3
22 CHECK-ERR3-COUNT-100x: else
23 ERRCOUNT3: [[@LINE-1]]:21: error: invalid count in -COUNT specification on prefix 'CHECK-ERR3'
25 ; RUN: %ProtectFileCheckOutput \
26 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-ERR4 2>&1 \
27 ; RUN: | FileCheck %s --check-prefix=ERRCOUNT4
28 CHECK-ERR4-COUNT-0: else
29 ERRCOUNT4: [[@LINE-1]]:19: error: invalid count in -COUNT specification on prefix 'CHECK-ERR4'
42 ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT1
43 CHECK-CNT1-COUNT-1: this is duplicate
44 CHECK-CNT1: this is duplicate
45 CHECK-CNT1-NEXT: this is not duplicate
47 ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT2
48 CHECK-CNT2-COUNT-2: this is duplicate
49 CHECK-CNT2: this is not duplicate
51 ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT3
52 CHECK-CNT3-COUNT-2: this is duplicate
53 CHECK-CNT3: this is not duplicate
54 CHECK-CNT3-COUNT-3: this is duplicate
55 CHECK-CNT3-NOT: {{^}}this is duplicate
57 ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNT4
58 CHECK-CNT4-COUNT-5: this is duplicate
80 ; RUN: FileCheck %s --input-file %s --check-prefix=CHECK-CNTMANY
81 CHECK-CNTMANY-COUNT-2: this is duplicate
82 CHECK-CNTMANY-LABEL: Many-label:
84 CHECK-CNTMANY-COUNT-16: {{^}}-many-
88 ; Tests on mismatches:
91 ; RUN: %ProtectFileCheckOutput \
92 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS1 2>&1 \
93 ; RUN: | FileCheck %s --check-prefix=MISCOUNT1
94 CHECK-MIS1-COUNT-3: this is duplicate
95 CHECK-MIS1: {{^}}this is not duplicate
96 MISCOUNT1: [[@LINE-1]]:13: error: CHECK-MIS1: expected string not found in input
98 ; RUN: %ProtectFileCheckOutput \
99 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS2 2>&1 \
100 ; RUN: | FileCheck %s --check-prefix=MISCOUNT2
101 CHECK-MIS2-COUNT-10: {{^this is duplicate}}
102 CHECK-MIS2: {{^}}this is not duplicate
103 MISCOUNT2: [[@LINE-2]]:22: error: CHECK-MIS2-COUNT: expected string not found in input
105 ; RUN: %ProtectFileCheckOutput \
106 ; RUN: not FileCheck %s --input-file %s --check-prefix=CHECK-MIS3 2>&1 \
107 ; RUN: | FileCheck %s --check-prefix=MISCOUNT3
108 CHECK-MIS3-COUNT-5: this is duplicate
110 CHECK-MIS3-LABEL: Many-label:
112 CHECK-MIS3-COUNT-160: {{^}}-many-
114 MISCOUNT3: [[@LINE-2]]:23: error: CHECK-MIS3-COUNT: expected string not found in input (17 out of 160)