2 // RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s
4 // Please note that all comments are inside "#if 0" blocks so that
5 // VerifyDiagnosticConsumer sees no comments while processing this
6 // test-case (and hence no expected-* directives).
13 // expected-error {{should be ignored}}
15 // CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
16 // CHECK-NEXT: error: 'expected-error' diagnostics seen but not expected:
17 // CHECK-NEXT: Line 5: header
18 // CHECK-NEXT: Line 10: source
19 // CHECK-NEXT: 3 errors generated.
23 // RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
25 // The following checks that -verify can match "any line" in an included file.
26 // The location of the diagnostic need therefore only match in the file, not to
27 // a specific line number. This is useful where -verify is used as a testing
28 // tool for 3rd-party libraries where headers may change and the specific line
29 // number of a diagnostic in a header is not important.
31 // expected-error@verify2.h:* {{header}}
32 // expected-error@verify2.h:* {{unknown}}
34 // CHECK2: error: 'expected-error' diagnostics expected but not seen:
35 // CHECK2-NEXT: File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
36 // CHECK2-NEXT: error: 'expected-error' diagnostics seen but not expected:
37 // CHECK2-NEXT: File {{.*}}verify2.c Line 10: source
38 // CHECK2-NEXT: 2 errors generated.