Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 1 | ;-------------------------------------------------- |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 2 | ; Use -strict-whitespace to check marker and note alignment here. |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 3 | ; (Also check multiline marker where start/end columns vary across lines.) |
| 4 | ; |
| 5 | ; In the remaining checks, don't use -strict-whitespace and thus check just the |
| 6 | ; presence, order, and lengths of markers. That way, if we ever change padding |
| 7 | ; within line labels, we don't have to adjust so many tests. |
| 8 | ;-------------------------------------------------- |
| 9 | |
| 10 | ; RUN: echo 'hello world' > %t.in |
| 11 | ; RUN: echo 'goodbye' >> %t.in |
| 12 | ; RUN: echo 'world' >> %t.in |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 13 | ; RUN: echo 'unicorn' >> %t.in |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 14 | |
| 15 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 16 | ; RUN: echo 'CHECK: universe' >> %t.chk |
| 17 | |
| 18 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 19 | ; RUN: | FileCheck -strict-whitespace -match-full-lines -check-prefix=ALIGN \ |
| 20 | ; RUN: -implicit-check-not='remark:' %s |
| 21 | |
| 22 | ; Verbose diagnostics are suppressed but not errors. |
| 23 | ; ALIGN:{{.*}}error:{{.*}} |
| 24 | ; ALIGN:{{.*}}possible intended match here{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 25 | |
| 26 | ; ALIGN:Full input was: |
| 27 | ; ALIGN-NEXT:<<<<<< |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 28 | ; ALIGN-NEXT: 1: hello world |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 29 | ; ALIGN-NEXT:check:1 ^~~~~ |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 30 | ; ALIGN-NEXT:check:2'0 X~~~~ |
| 31 | ; ALIGN-NEXT: 2: goodbye |
| 32 | ; ALIGN-NEXT:check:2'0 ~~~~~~~ |
| 33 | ; ALIGN-NEXT: 3: world |
| 34 | ; ALIGN-NEXT:check:2'0 ~~~~~ |
| 35 | ; ALIGN-NEXT: 4: unicorn |
| 36 | ; ALIGN-NEXT:check:2'0 ~~~~~~~ error: no match found |
| 37 | ; ALIGN-NEXT:check:2'1 ? possible intended match |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 38 | ; ALIGN-NEXT:>>>>>> |
| 39 | ; ALIGN-NOT:{{.}} |
| 40 | |
| 41 | ;-------------------------------------------------- |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 42 | ; CHECK (also: multi-line search range, fuzzy match) |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 43 | ;-------------------------------------------------- |
| 44 | |
| 45 | ; Good match and no match. |
| 46 | |
| 47 | ; RUN: echo 'hello' > %t.in |
| 48 | ; RUN: echo 'again' >> %t.in |
| 49 | ; RUN: echo 'whirled' >> %t.in |
| 50 | |
| 51 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 52 | ; RUN: echo 'CHECK: world' >> %t.chk |
| 53 | |
| 54 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 55 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=CHK \ |
| 56 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 57 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 58 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V \ |
| 59 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 60 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 61 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CHK,CHK-V \ |
| 62 | ; RUN: -implicit-check-not='remark:' |
| 63 | |
| 64 | ; Verbose diagnostics are suppressed but not errors. |
| 65 | ; CHK: {{.*}}error:{{.*}} |
| 66 | ; CHK: {{.*}}possible intended match here{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 67 | |
| 68 | ; CHK: <<<<<< |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 69 | ; CHK-NEXT: 1: hello |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 70 | ; CHK-V-NEXT: check:1 ^~~~~ |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 71 | ; CHK-NEXT: 2: again |
| 72 | ; CHK-NEXT: check:2'0 X~~~~ |
| 73 | ; CHK-NEXT: 3: whirled |
| 74 | ; CHK-NEXT: check:2'0 ~~~~~~~ error: no match found |
| 75 | ; CHK-NEXT: check:2'1 ? possible intended match |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 76 | ; CHK-NEXT: >>>>>> |
| 77 | ; CHK-NOT: {{.}} |
| 78 | |
| 79 | ;-------------------------------------------------- |
| 80 | ; CHECK-COUNT-<num> |
| 81 | ;-------------------------------------------------- |
| 82 | |
| 83 | ; Good match and no match. |
| 84 | |
| 85 | ; RUN: echo 'pete' > %t.in |
| 86 | ; RUN: echo 'repete' >> %t.in |
| 87 | ; RUN: echo 'repeat' >> %t.in |
| 88 | |
| 89 | ; RUN: echo 'CHECK-COUNT-3: pete' > %t.chk |
| 90 | |
| 91 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 92 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-Q \ |
| 93 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 94 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 95 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V \ |
| 96 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 97 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 98 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=CNT,CNT-V \ |
| 99 | ; RUN: -implicit-check-not='remark:' |
| 100 | |
| 101 | ; Verbose diagnostics are suppressed but not errors. |
| 102 | ; CNT: {{.*}}error:{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 103 | |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 104 | ; CNT: <<<<<< |
| 105 | ; CNT-NEXT: 1: pete |
| 106 | ; CNT-V-NEXT: count:1'0 ^~~~ |
| 107 | ; CNT-NEXT: 2: repete |
| 108 | ; CNT-V-NEXT: count:1'1 ^~~~ |
| 109 | ; CNT-NEXT: 3: repeat |
| 110 | ; CNT-Q-NEXT: count:1 X~~~~~ error: no match found |
| 111 | ; CNT-V-NEXT: count:1'2 X~~~~~ error: no match found |
| 112 | ; CNT-NEXT: >>>>>> |
| 113 | ; CNT-NOT: {{.}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 114 | |
| 115 | ;-------------------------------------------------- |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 116 | ; CHECK-NEXT (also: EOF search-range, wrong-line match) |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 117 | ;-------------------------------------------------- |
| 118 | |
| 119 | ; Good match and no match. |
| 120 | |
| 121 | ; RUN: echo 'hello' > %t.in |
| 122 | ; RUN: echo 'again' >> %t.in |
| 123 | |
| 124 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 125 | ; RUN: echo 'CHECK-NEXT: again' >> %t.chk |
| 126 | ; RUN: echo 'CHECK-NEXT: world' >> %t.chk |
| 127 | |
| 128 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 129 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=NXT \ |
| 130 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 131 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 132 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V \ |
| 133 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 134 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 135 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NXT,NXT-V,NXT-VV \ |
| 136 | ; RUN: -implicit-check-not='remark:' |
| 137 | |
| 138 | ; Verbose diagnostics are suppressed but not errors. |
| 139 | ; NXT: {{.*}}error:{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 140 | |
| 141 | ; NXT: <<<<<< |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 142 | ; NXT-NEXT: 1: hello |
| 143 | ; NXT-V-NEXT: check:1 ^~~~~ |
| 144 | ; NXT-NEXT: 2: again |
| 145 | ; NXT-V-NEXT: next:2 ^~~~~ |
| 146 | ; NXT-NEXT: 3: |
| 147 | ; NXT-NEXT: next:3 X error: no match found |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 148 | ; NXT-NEXT: >>>>>> |
| 149 | ; NXT-NOT: {{.}} |
| 150 | |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 151 | ; Wrong-line match. |
| 152 | |
| 153 | ; RUN: echo 'yonder' >> %t.in |
| 154 | ; RUN: echo 'world' >> %t.in |
| 155 | |
| 156 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
| 157 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=NXT2 |
| 158 | |
| 159 | ; NXT2: <<<<<< |
| 160 | ; NXT2-NEXT: 1: hello |
| 161 | ; NXT2-NEXT: 2: again |
| 162 | ; NXT2-NEXT: 3: yonder |
| 163 | ; NXT2-NEXT: 4: world |
| 164 | ; NXT2-NEXT: next:3 !~~~~ error: match on wrong line |
| 165 | ; NXT2-NEXT: >>>>>> |
| 166 | ; NXT2-NOT: {{.}} |
| 167 | |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 168 | ;-------------------------------------------------- |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 169 | ; CHECK-SAME (also: multiple annotations per line, single-char search range, |
| 170 | ; wrong-line match) |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 171 | ;-------------------------------------------------- |
| 172 | |
| 173 | ; Good match and no match. |
| 174 | |
| 175 | ; RUN: echo 'hello world!' > %t.in |
| 176 | |
| 177 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 178 | ; RUN: echo 'CHECK-SAME: world' >> %t.chk |
| 179 | ; RUN: echo 'CHECK-SAME: again' >> %t.chk |
| 180 | |
| 181 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 182 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=SAM \ |
| 183 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 184 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 185 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V \ |
| 186 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 187 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 188 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM,SAM-V,SAM-VV \ |
| 189 | ; RUN: -implicit-check-not='remark:' |
| 190 | |
| 191 | ; Verbose diagnostics are suppressed but not errors. |
| 192 | ; SAM: {{.*}}error:{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 193 | |
| 194 | ; SAM: <<<<<< |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 195 | ; SAM-NEXT: 1: hello world! |
| 196 | ; SAM-V-NEXT: check:1 ^~~~~ |
| 197 | ; SAM-V-NEXT: same:2 ^~~~~ |
| 198 | ; SAM-NEXT: same:3 X error: no match found |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 199 | ; SAM-NEXT: >>>>>> |
| 200 | ; SAM-NOT: {{.}} |
| 201 | |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 202 | ; Wrong-line match. |
| 203 | |
| 204 | ; RUN: echo 'again' >> %t.in |
| 205 | |
| 206 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 207 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=SAM2 \ |
| 208 | ; RUN: -implicit-check-not='remark:' |
| 209 | |
| 210 | ; Verbose diagnostics are suppressed but not errors. |
| 211 | ; SAM2: {{.*}}error:{{.*}} |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 212 | |
| 213 | ; SAM2: <<<<<< |
| 214 | ; SAM2-NEXT: 1: hello world! |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 215 | ; SAM2-NEXT: check:1 ^~~~~ |
| 216 | ; SAM2-NEXT: same:2 ^~~~~ |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 217 | ; SAM2-NEXT: 2: again |
| 218 | ; SAM2-NEXT: same:3 !~~~~ error: match on wrong line |
| 219 | ; SAM2-NEXT: >>>>>> |
| 220 | ; SAM2-NOT: {{.}} |
| 221 | |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 222 | ;-------------------------------------------------- |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 223 | ; CHECK-EMPTY (also: search range ends at label, single-char match, wrong-line |
| 224 | ; match) |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 225 | ;-------------------------------------------------- |
| 226 | |
| 227 | ; Good match and no match. |
| 228 | ; |
| 229 | ; CHECK-EMPTY always seems to match an empty line at EOF (illegally when it's |
| 230 | ; not the next line) unless either (1) the last line is non-empty and has no |
| 231 | ; newline or (2) there's a CHECK-LABEL to end the search range before EOF. We |
| 232 | ; choose scenario 2 to check the case of no match. |
| 233 | |
| 234 | ; RUN: echo 'hello' > %t.in |
| 235 | ; RUN: echo '' >> %t.in |
| 236 | ; RUN: echo 'world' >> %t.in |
| 237 | ; RUN: echo 'label' >> %t.in |
| 238 | |
| 239 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 240 | ; RUN: echo 'CHECK-EMPTY:' >> %t.chk |
| 241 | ; RUN: echo 'CHECK-EMPTY:' >> %t.chk |
| 242 | ; RUN: echo 'CHECK-LABEL: label' >> %t.chk |
| 243 | |
| 244 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 245 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=EMP \ |
| 246 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 247 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 248 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V \ |
| 249 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 250 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 251 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP,EMP-V,EMP-VV \ |
| 252 | ; RUN: -implicit-check-not='remark:' |
| 253 | |
| 254 | ; Verbose diagnostics are suppressed but not errors. |
| 255 | ; EMP: {{.*}}error:{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 256 | |
| 257 | ; EMP: <<<<<< |
| 258 | ; EMP-NEXT: 1: hello |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 259 | ; EMP-V-NEXT: check:1 ^~~~~ |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 260 | ; EMP-NEXT: 2: |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 261 | ; EMP-V-NEXT: empty:2 ^ |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 262 | ; EMP-NEXT: 3: world |
| 263 | ; EMP-NEXT: empty:3 X~~~~ |
| 264 | ; EMP-NEXT: 4: label |
| 265 | ; EMP-NEXT: empty:3 ~~~~~ error: no match found |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 266 | ; EMP-V-NEXT: label:4 ^~~~~ |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 267 | ; EMP-NEXT: >>>>>> |
| 268 | ; EMP-NOT: {{.}} |
| 269 | |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 270 | ; Wrong-line match. |
| 271 | |
| 272 | ; RUN: echo 'hello' > %t.in |
| 273 | ; RUN: echo 'world' >> %t.in |
| 274 | |
| 275 | ; RUN: echo 'CHECK: hello' > %t.chk |
| 276 | ; RUN: echo 'CHECK-EMPTY:' >> %t.chk |
| 277 | |
| 278 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 279 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=EMP2 \ |
| 280 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 281 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 282 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP2,EMP2-V \ |
| 283 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 284 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 285 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=EMP2,EMP2-V,EMP2-VV \ |
| 286 | ; RUN: -implicit-check-not='remark:' |
| 287 | |
| 288 | ; Verbose diagnostics are suppressed but not errors. |
| 289 | ; EMP2: {{.*}}error:{{.*}} |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 290 | |
| 291 | ; EMP2: <<<<<< |
| 292 | ; EMP2-NEXT: 1: hello |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 293 | ; EMP2-V-NEXT: check:1 ^~~~~ |
Joel E. Denny | cadfcef | 2018-12-18 00:02:22 +0000 | [diff] [blame] | 294 | ; EMP2-NEXT: 2: world |
| 295 | ; EMP2-NEXT: 3: |
| 296 | ; EMP2-NEXT: empty:2 ! error: match on wrong line |
| 297 | ; EMP2-NEXT: >>>>>> |
| 298 | ; EMP2-NOT: {{.}} |
| 299 | |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 300 | ;-------------------------------------------------- |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 301 | ; CHECK-NOT (also: EOF pattern, and multiline range that ends before EOL) |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 302 | ;-------------------------------------------------- |
| 303 | |
| 304 | ; No match (success) and unexpected match (error). |
| 305 | |
| 306 | ; RUN: echo 'hello' > %t.in |
| 307 | ; RUN: echo 'world' >> %t.in |
| 308 | ; RUN: echo 'again' >> %t.in |
| 309 | |
| 310 | ; RUN: echo 'CHECK-NOT: goodbye' > %t.chk |
| 311 | ; RUN: echo 'CHECK-NOT: world' >> %t.chk |
| 312 | |
| 313 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 314 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=NOT \ |
| 315 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 316 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 317 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT,NOT-V \ |
| 318 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 319 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 320 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT,NOT-V,NOT-VV \ |
| 321 | ; RUN: -implicit-check-not='remark:' |
| 322 | |
| 323 | ; Verbose diagnostics are suppressed but not errors. |
| 324 | ; NOT: {{.*}}error:{{.*}} |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 325 | |
| 326 | ; NOT: <<<<<< |
| 327 | ; NOT-NEXT: 1: hello |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 328 | ; NOT-VV-NEXT: not:1 X~~~~ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 329 | ; NOT-NEXT: 2: world |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 330 | ; NOT-VV-NEXT: not:1 ~~~~~ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 331 | ; NOT-NEXT: not:2 !~~~~ error: no match expected |
| 332 | ; NOT-NEXT: 3: again |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 333 | ; NOT-VV-NEXT: not:1 ~~~~~ |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 334 | ; NOT-VV-NEXT: 4: |
| 335 | ; NOT-VV-NEXT: eof:2 ^ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 336 | ; NOT-NEXT: >>>>>> |
| 337 | ; NOT-NOT: {{.}} |
| 338 | |
| 339 | ; Again, but with a CHECK instead of EOF as search range end. |
| 340 | |
| 341 | ; RUN: echo 'CHECK: ain' >> %t.chk |
| 342 | |
| 343 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 344 | ; RUN: | FileCheck -match-full-lines %s -check-prefix=NOT2 \ |
| 345 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 346 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 347 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT2,NOT2-V \ |
| 348 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 349 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 350 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=NOT2,NOT2-V,NOT2-VV \ |
| 351 | ; RUN: -implicit-check-not='remark:' |
| 352 | |
| 353 | ; Verbose diagnostics are suppressed but not errors. |
| 354 | ; NOT2: {{.*}}error:{{.*}} |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 355 | |
| 356 | ; NOT2: <<<<<< |
| 357 | ; NOT2-NEXT: 1: hello |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 358 | ; NOT2-VV-NEXT: not:1 X~~~~ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 359 | ; NOT2-NEXT: 2: world |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 360 | ; NOT2-VV-NEXT: not:1 ~~~~~ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 361 | ; NOT2-NEXT: not:2 !~~~~ error: no match expected |
| 362 | ; NOT2-NEXT: 3: again |
Joel E. Denny | 96f0e84 | 2018-12-18 00:03:36 +0000 | [diff] [blame] | 363 | ; NOT2-VV-NEXT: not:1 ~~ |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 364 | ; NOT2-V-NEXT: check:3 ^~~ |
Joel E. Denny | 0e7e3fa | 2018-12-18 00:02:47 +0000 | [diff] [blame] | 365 | ; NOT2-NEXT: >>>>>> |
| 366 | ; NOT2-NOT: {{.}} |
| 367 | |
| 368 | ;-------------------------------------------------- |
Joel E. Denny | f7c1c4d | 2018-12-18 00:03:19 +0000 | [diff] [blame] | 369 | ; CHECK-DAG (also: matches in different order than directives, discarded match) |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 370 | ;-------------------------------------------------- |
| 371 | |
| 372 | ; Good match, discarded match plus good match, and no match. |
| 373 | |
| 374 | ; RUN: echo 'abc' > %t.in |
| 375 | ; RUN: echo 'def' >> %t.in |
| 376 | ; RUN: echo 'abc' >> %t.in |
| 377 | |
| 378 | ; RUN: echo 'CHECK-DAG: def' > %t.chk |
| 379 | ; RUN: echo 'CHECK-DAG: abc' >> %t.chk |
| 380 | ; RUN: echo 'CHECK-DAG: abc' >> %t.chk |
| 381 | ; RUN: echo 'CHECK-DAG: def' >> %t.chk |
| 382 | |
Joel E. Denny | e2afb61 | 2018-12-18 00:03:51 +0000 | [diff] [blame] | 383 | ; Prefixes used here: |
| 384 | ; DAG = quiet, -v, or -vv |
| 385 | ; DAG-Q = quiet |
| 386 | ; DAG-V = -v or -vv (-vv implies -v) |
| 387 | ; DAG-VQ = -v and not -vv |
| 388 | ; DAG-VV = -vv |
| 389 | |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 390 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 391 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-Q \ |
| 392 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 393 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 394 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-V,DAG-VQ \ |
| 395 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 396 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 397 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=DAG,DAG-V,DAG-VV \ |
| 398 | ; RUN: -implicit-check-not='remark:' |
| 399 | |
| 400 | ; Verbose diagnostics are suppressed but not errors. |
| 401 | ; DAG: {{.*}}error:{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 402 | |
| 403 | ; DAG: <<<<<< |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 404 | ; DAG-NEXT: 1: abc |
| 405 | ; DAG-V-NEXT: dag:2 ^~~ |
Joel E. Denny | f7c1c4d | 2018-12-18 00:03:19 +0000 | [diff] [blame] | 406 | ; DAG-VV-NEXT: dag:3'0 !~~ discard: overlaps earlier match |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 407 | ; DAG-NEXT: 2: def |
| 408 | ; DAG-V-NEXT: dag:1 ^~~ |
Joel E. Denny | f7c1c4d | 2018-12-18 00:03:19 +0000 | [diff] [blame] | 409 | ; DAG-VV-NEXT: dag:4'0 !~~ discard: overlaps earlier match |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 410 | ; DAG-NEXT: 3: abc |
Joel E. Denny | f7c1c4d | 2018-12-18 00:03:19 +0000 | [diff] [blame] | 411 | ; DAG-VQ-NEXT: dag:3 ^~~ |
| 412 | ; DAG-VV-NEXT: dag:3'1 ^~~ |
| 413 | ; DAG-Q-NEXT: dag:4 X~~ error: no match found |
| 414 | ; DAG-VQ-NEXT: dag:4 X~~ error: no match found |
| 415 | ; DAG-VV-NEXT: dag:4'1 X~~ error: no match found |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 416 | ; DAG-NEXT: >>>>>> |
| 417 | ; DAG-NOT: {{.}} |
| 418 | |
| 419 | ;-------------------------------------------------- |
| 420 | ; CHECK-LABEL |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 421 | ; |
| 422 | ; FIXME: Labels sometimes produce redundant diagnostics for good matches. |
| 423 | ; That bug is independent of but affects -dump-input. |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 424 | ;-------------------------------------------------- |
| 425 | |
| 426 | ; Good match and no match. |
| 427 | |
| 428 | ; RUN: echo 'lab0' > %t.in |
| 429 | ; RUN: echo 'foo' >> %t.in |
| 430 | ; RUN: echo 'lab1' >> %t.in |
| 431 | ; RUN: echo 'bar' >> %t.in |
| 432 | |
| 433 | ; RUN: echo 'CHECK-LABEL: lab0' > %t.chk |
| 434 | ; RUN: echo 'CHECK: foo' >> %t.chk |
| 435 | ; RUN: echo 'CHECK-LABEL: lab2' >> %t.chk |
| 436 | |
| 437 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 438 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB \ |
| 439 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 440 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -v 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 441 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V \ |
| 442 | ; RUN: -implicit-check-not='remark:' |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 443 | ; RUN: not FileCheck -dump-input=always -input-file %t.in %t.chk -vv 2>&1 \ |
Joel E. Denny | 352695c | 2019-01-22 21:41:42 +0000 | [diff] [blame] | 444 | ; RUN: | FileCheck -match-full-lines %s -check-prefixes=LAB,LAB-V,LAB-VV \ |
| 445 | ; RUN: -implicit-check-not='remark:' |
| 446 | |
| 447 | ; Verbose diagnostics are suppressed but not errors. |
| 448 | ; LAB: {{.*}}error:{{.*}} |
| 449 | ; LAB: {{.*}}possible intended match{{.*}} |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 450 | |
| 451 | ; LAB: <<<<<< |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 452 | ; LAB-NEXT: 1: lab0 |
Joel E. Denny | 7df8696 | 2018-12-18 00:03:03 +0000 | [diff] [blame] | 453 | ; LAB-V-NEXT: label:1'0 ^~~~ |
| 454 | ; LAB-V-NEXT: label:1'1 ^~~~ |
Joel E. Denny | 2c007c8 | 2018-12-18 00:02:04 +0000 | [diff] [blame] | 455 | ; LAB-NEXT: 2: foo |
| 456 | ; LAB-NEXT: label:3'0 X~~ |
| 457 | ; LAB-NEXT: 3: lab1 |
| 458 | ; LAB-NEXT: label:3'0 ~~~~ |
| 459 | ; LAB-NEXT: label:3'1 ? possible intended match |
| 460 | ; LAB-NEXT: 4: bar |
| 461 | ; LAB-NEXT: label:3'0 ~~~ error: no match found |
Joel E. Denny | 3c5d267 | 2018-12-18 00:01:39 +0000 | [diff] [blame] | 462 | ; LAB-NEXT: >>>>>> |
| 463 | ; LAB-NOT: {{.}} |