1; Check handling of diagnostics for problematic matches (e.g., variable capture
2; overflow) in the case of expected patterns (e.g., CHECK).
3
4RUN: echo > %t.chk 'CHECK: [[#122+1]] [[STR:abc]] [[#NUM:]]'
5RUN: echo > %t.in '123 abc 1000000000000000000000000000000000000000000000000000'
6
7  ERR-NOT:{{.}}
8      ERR:{{.*}}: remark: CHECK: expected string found in input
9 ERR-NEXT:CHECK: {{.*}}
10 ERR-NEXT:{{ *}}^
11 ERR-NEXT:<stdin>:1:1: note: found here
12 ERR-NEXT:123 abc 10{{0*}}
13 ERR-NEXT:^~~~~~~~~{{~*}}
14 ERR-NEXT:<stdin>:1:1: note: with "122+1" equal to "123"
15 ERR-NEXT:123 abc 10{{0*}}
16 ERR-NEXT:^
17 ERR-NEXT:<stdin>:1:5: note: captured var "STR"
18 ERR-NEXT:123 abc 10{{0*}}
19 ERR-NEXT:    ^~~
20 ERR-NEXT:<stdin>:1:9: error: unable to represent numeric value
21 ERR-NEXT:123 abc 10{{0*}}
22 ERR-NEXT:        ^
23  ERR-NOT:{{error|note|remark}}:
24
25     DUMP:<<<<<<
26DUMP-NEXT:           1: 123 abc 10{{0*}}
27DUMP-NEXT:check:1'0     ^~~~~~~~~~{{~*}}
28DUMP-NEXT:check:1'1                       with "122+1" equal to "123"
29DUMP-NEXT:check:1'2         ^~~           captured var "STR"
30DUMP-NEXT:check:1'3             !~{{~*}}  error: unable to represent numeric value
31DUMP-NEXT:>>>>>>
32
33;--------------------------------------------------
34; Check -dump-input=never cases.
35;--------------------------------------------------
36
37RUN: %ProtectFileCheckOutput \
38RUN: not FileCheck -dump-input=never %t.chk < %t.in 2>&1 \
39RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR
40
41RUN: %ProtectFileCheckOutput \
42RUN: not FileCheck -dump-input=never -v %t.chk < %t.in 2>&1 \
43RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR
44
45RUN: %ProtectFileCheckOutput \
46RUN: not FileCheck -dump-input=never -vv %t.chk < %t.in 2>&1 \
47RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR
48
49;--------------------------------------------------
50; Check -dump-input=fail cases.
51;--------------------------------------------------
52
53RUN: %ProtectFileCheckOutput \
54RUN: not FileCheck -dump-input=fail %t.chk < %t.in 2>&1 \
55RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP
56
57RUN: %ProtectFileCheckOutput \
58RUN: not FileCheck -dump-input=fail -v %t.chk < %t.in 2>&1 \
59RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP
60
61RUN: %ProtectFileCheckOutput \
62RUN: not FileCheck -dump-input=fail -vv %t.chk < %t.in 2>&1 \
63RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP
64