150
|
1 #if 0
|
|
2 // RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s
|
|
3
|
|
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).
|
|
7 #endif
|
|
8
|
|
9 #include "verify2.h"
|
|
10 #error source
|
|
11
|
|
12 #if 0
|
|
13 // expected-error {{should be ignored}}
|
|
14
|
|
15 // CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
|
|
16 // CHECK-NEXT: error: 'error' diagnostics seen but not expected:
|
|
17 // CHECK-NEXT: Line 5: header
|
|
18 // CHECK-NEXT: Line 10: source
|
|
19 // CHECK-NEXT: 3 errors generated.
|
|
20 #endif
|
|
21
|
|
22 #ifdef CHECK2
|
|
23 // RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
|
|
24
|
|
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.
|
|
30
|
|
31 // expected-error@verify2.h:* {{header}}
|
|
32 // expected-error@verify2.h:* {{unknown}}
|
|
33
|
|
34 // CHECK2: error: 'error' diagnostics expected but not seen:
|
|
35 // CHECK2-NEXT: File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
|
|
36 // CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
|
|
37 // CHECK2-NEXT: File {{.*}}verify2.c Line 10: source
|
|
38 // CHECK2-NEXT: 2 errors generated.
|
|
39 #endif
|