File: verify2.c

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (39 lines) | stat: -rw-r--r-- 1,479 bytes parent folder | download | duplicates (29)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#if 0
// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s

// Please note that all comments are inside "#if 0" blocks so that
// VerifyDiagnosticConsumer sees no comments while processing this
// test-case (and hence no expected-* directives).
#endif

#include "verify2.h"
#error source

#if 0
// expected-error {{should be ignored}}

//      CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK-NEXT:   Line 5: header
// CHECK-NEXT:   Line 10: source
// CHECK-NEXT: 3 errors generated.
#endif

#ifdef CHECK2
// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s

// The following checks that -verify can match "any line" in an included file.
// The location of the diagnostic need therefore only match in the file, not to
// a specific line number.  This is useful where -verify is used as a testing
// tool for 3rd-party libraries where headers may change and the specific line
// number of a diagnostic in a header is not important.

// expected-error@verify2.h:* {{header}}
// expected-error@verify2.h:* {{unknown}}

//      CHECK2: error: 'error' diagnostics expected but not seen:
// CHECK2-NEXT:   File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK2-NEXT:   File {{.*}}verify2.c Line 10: source
// CHECK2-NEXT: 2 errors generated.
#endif