Home | History | Annotate | Download | only in Misc
      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
      6 X(int n = error);
      7 
      8 // PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error'
      9 // PRESUMED: diag-presumed.c:100:14: note: expanded from
     10 // SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error'
     11 // SPELLING: diag-presumed.c:5:14: note: expanded from
     12 
     13 ;
     14 // PRESUMED: diag-presumed.c:108:1: error: extra ';' outside of a functio
     15 // SPELLING: diag-presumed.c:13:1: error: extra ';' outside of a functio
     16 
     17 # 1 "thing1.cc" 1
     18 # 1 "thing1.h" 1
     19 # 1 "systemheader.h" 1 3
     20 ;
     21 // No diagnostic here: we're in a system header, even if we're using spelling
     22 // locations for the diagnostics..
     23 // PRESUMED-NOT: extra ';'
     24 // SPELLING-NOT: extra ';'
     25 
     26 another error;
     27 // PRESUMED: included from {{.*}}diag-presumed.c:112:
     28 // PRESUMED: from thing1.cc:1:
     29 // PRESUMED: from thing1.h:1:
     30 // PRESUMED: systemheader.h:7:1: error: unknown type name 'another'
     31 
     32 // SPELLING-NOT: included from
     33 // SPELLING: diag-presumed.c:26:1: error: unknown type name 'another'
     34 
     35 # 1 "thing1.h" 2
     36 # 1 "thing1.cc" 2
     37