Clang Project

clang_source_code/test/Misc/diag-presumed.c
1// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED
2// RUN: not %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING
3
4#line 100
5#define X(y) y
6X(int n = error);
7
8// PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error'
9// SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error'
10
11;
12// PRESUMED: diag-presumed.c:106:1: error: extra ';' outside of a functio
13// SPELLING: diag-presumed.c:11:1: error: extra ';' outside of a functio
14
15# 1 "thing1.cc" 1
16# 1 "thing1.h" 1
17# 1 "systemheader.h" 1 3
18;
19// No diagnostic here: we're in a system header, even if we're using spelling
20// locations for the diagnostics..
21// PRESUMED-NOT: extra ';'
22// SPELLING-NOT: extra ';'
23
24another error;
25// PRESUMED: included from {{.*}}diag-presumed.c:110:
26// PRESUMED: from thing1.cc:1:
27// PRESUMED: from thing1.h:1:
28// PRESUMED: systemheader.h:7:1: error: unknown type name 'another'
29
30// SPELLING-NOT: included from
31// SPELLING: diag-presumed.c:24:1: error: unknown type name 'another'
32
33# 1 "thing1.h" 2
34# 1 "thing1.cc" 2
35