xref: /llvm-project/clang/test/Misc/diag-presumed.c (revision ecd36ee80b7a6ac73c84da19f8a75c4c025a7625)
1925213b0SRafael Espindola // RUN: not %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED
2925213b0SRafael Espindola // RUN: not %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING
30b50cb79SRichard Smith 
40b50cb79SRichard Smith #line 100
50b50cb79SRichard Smith #define X(y) y
60b50cb79SRichard Smith X(int n = error);
70b50cb79SRichard Smith 
80b50cb79SRichard Smith // PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error'
90b50cb79SRichard Smith // SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error'
100b50cb79SRichard Smith 
110b50cb79SRichard Smith ;
12*ecd36ee8SRichard Trieu // PRESUMED: diag-presumed.c:106:1: error: extra ';' outside of a functio
13*ecd36ee8SRichard Trieu // SPELLING: diag-presumed.c:11:1: error: extra ';' outside of a functio
140b50cb79SRichard Smith 
150b50cb79SRichard Smith # 1 "thing1.cc" 1
160b50cb79SRichard Smith # 1 "thing1.h" 1
170b50cb79SRichard Smith # 1 "systemheader.h" 1 3
180b50cb79SRichard Smith ;
190b50cb79SRichard Smith // No diagnostic here: we're in a system header, even if we're using spelling
200b50cb79SRichard Smith // locations for the diagnostics..
210b50cb79SRichard Smith // PRESUMED-NOT: extra ';'
220b50cb79SRichard Smith // SPELLING-NOT: extra ';'
230b50cb79SRichard Smith 
240b50cb79SRichard Smith another error;
25*ecd36ee8SRichard Trieu // PRESUMED: included from {{.*}}diag-presumed.c:110:
260b50cb79SRichard Smith // PRESUMED: from thing1.cc:1:
270b50cb79SRichard Smith // PRESUMED: from thing1.h:1:
280b50cb79SRichard Smith // PRESUMED: systemheader.h:7:1: error: unknown type name 'another'
290b50cb79SRichard Smith 
300b50cb79SRichard Smith // SPELLING-NOT: included from
31*ecd36ee8SRichard Trieu // SPELLING: diag-presumed.c:24:1: error: unknown type name 'another'
320b50cb79SRichard Smith 
330b50cb79SRichard Smith # 1 "thing1.h" 2
340b50cb79SRichard Smith # 1 "thing1.cc" 2
35