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