162221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// RUN: %clang_cc1 -fsyntax-only -pedantic-errors %s 2>&1 | FileCheck %s --check-prefix=PRESUMED
262221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// RUN: %clang_cc1 -fsyntax-only -pedantic-errors -fno-diagnostics-use-presumed-location %s 2>&1 | FileCheck %s --check-prefix=SPELLING
362221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
462221b17c90457df9ca0ff20bb54d634e8951defRichard Smith#line 100
562221b17c90457df9ca0ff20bb54d634e8951defRichard Smith#define X(y) y
662221b17c90457df9ca0ff20bb54d634e8951defRichard SmithX(int n = error);
762221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
862221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: diag-presumed.c:101:11: error: use of undeclared identifier 'error'
962221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: diag-presumed.c:100:14: note: expanded from
1062221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING: diag-presumed.c:6:11: error: use of undeclared identifier 'error'
1162221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING: diag-presumed.c:5:14: note: expanded from
1262221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
1362221b17c90457df9ca0ff20bb54d634e8951defRichard Smith;
1462221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: diag-presumed.c:108:1: error: extra ';' outside of a functio
1562221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING: diag-presumed.c:13:1: error: extra ';' outside of a functio
1662221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
1762221b17c90457df9ca0ff20bb54d634e8951defRichard Smith# 1 "thing1.cc" 1
1862221b17c90457df9ca0ff20bb54d634e8951defRichard Smith# 1 "thing1.h" 1
1962221b17c90457df9ca0ff20bb54d634e8951defRichard Smith# 1 "systemheader.h" 1 3
2062221b17c90457df9ca0ff20bb54d634e8951defRichard Smith;
2162221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// No diagnostic here: we're in a system header, even if we're using spelling
2262221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// locations for the diagnostics..
2362221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED-NOT: extra ';'
2462221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING-NOT: extra ';'
2562221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
2662221b17c90457df9ca0ff20bb54d634e8951defRichard Smithanother error;
2762221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: included from {{.*}}diag-presumed.c:112:
2862221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: from thing1.cc:1:
2962221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: from thing1.h:1:
3062221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// PRESUMED: systemheader.h:7:1: error: unknown type name 'another'
3162221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
3262221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING-NOT: included from
3362221b17c90457df9ca0ff20bb54d634e8951defRichard Smith// SPELLING: diag-presumed.c:26:1: error: unknown type name 'another'
3462221b17c90457df9ca0ff20bb54d634e8951defRichard Smith
3562221b17c90457df9ca0ff20bb54d634e8951defRichard Smith# 1 "thing1.h" 2
3662221b17c90457df9ca0ff20bb54d634e8951defRichard Smith# 1 "thing1.cc" 2
37