1 ; Check handling of match-time diagnostics for invalid patterns (e.g.,
2 ; substitution overflow) in the case of excluded patterns (e.g., CHECK-NOT).
4 ; At one time, FileCheck's exit status was zero for this case. Moreover, it
5 ; printed the error diagnostic only if -vv was specified and input dumps were
6 ; disabled. Test every combination as the logic is hard to get right.
9 RUN: 'CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]] [[UNDEFVAR]]'
10 RUN: echo > %t.in '10000000000000000'
13 ERR-VV:{{.*}}: remark: implicit EOF: expected string found in input
14 ERR-VV-NEXT:CHECK-NOT: {{.*}}
16 ERR-VV-NEXT:{{.*}}: note: found here
20 ERR:{{.*}}: error: unable to substitute variable or numeric expression: overflow error
21 ERR-NEXT:CHECK-NOT: {{.*}}
23 ERR-NEXT:{{.*}}: error: undefined variable: UNDEFVAR
24 ERR-NEXT:{{CHECK-NOT: \[\[#0x8000000000000000\+0x8000000000000000\]\] \[\[UNDEFVAR\]\]}}
26 ERR-NOT:{{error|note|remark}}:
29 DUMP-NEXT: 1: 10000000000000000
30 DUMP-NEXT:not:1'0 X~~~~~~~~~~~~~~~~~ error: match failed for invalid pattern
31 DUMP-NEXT:not:1'1 unable to substitute variable or numeric expression: overflow error
32 DUMP-NEXT:not:1'2 undefined variable: UNDEFVAR
37 ;--------------------------------------------------
38 ; Check -dump-input=never cases.
39 ;--------------------------------------------------
41 RUN: %ProtectFileCheckOutput \
42 RUN: not FileCheck -dump-input=never %t.chk < %t.in 2>&1 \
43 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR
45 RUN: %ProtectFileCheckOutput \
46 RUN: not FileCheck -dump-input=never -v %t.chk < %t.in 2>&1 \
47 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR
49 RUN: %ProtectFileCheckOutput \
50 RUN: not FileCheck -dump-input=never -vv %t.chk < %t.in 2>&1 \
51 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,ERR-VV
53 ;--------------------------------------------------
54 ; Check -dump-input=fail cases.
55 ;--------------------------------------------------
57 RUN: %ProtectFileCheckOutput \
58 RUN: not FileCheck -dump-input=fail %t.chk < %t.in 2>&1 \
59 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP
61 RUN: %ProtectFileCheckOutput \
62 RUN: not FileCheck -dump-input=fail -v %t.chk < %t.in 2>&1 \
63 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP
65 RUN: %ProtectFileCheckOutput \
66 RUN: not FileCheck -dump-input=fail -vv %t.chk < %t.in 2>&1 \
67 RUN: | FileCheck %s -match-full-lines -check-prefixes=ERR,DUMP,DUMP-VV