Skip to content

[clang][modules] rename "AST" to precompiled in diagnostic messages NFCI #142635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions clang/include/clang/Basic/DiagnosticSerializationKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def err_fe_unable_to_read_pch_file : Error<
"unable to read PCH file %0: '%1'">;
def err_fe_not_a_pch_file : Error<
"input is not a PCH file: '%0'">;
def err_fe_pch_malformed : Error<
"malformed or corrupted AST file: '%0'">, DefaultFatal;
def err_fe_ast_file_malformed : Error<
"malformed or corrupted precompiled file: '%0'">, DefaultFatal;
def err_fe_pch_malformed_block : Error<
"malformed block record in PCH file: '%0'">, DefaultFatal;
def err_fe_ast_file_modified : Error<
"file '%0' has been modified since the "
"%select{precompiled header|module file|AST file}1 '%2' was built"
"%select{precompiled header|module file|precompiled file}1 '%2' was built"
": %select{size|mtime|content}3 changed%select{| (was %5, now %6)}4">,
DefaultFatal;
def err_fe_pch_file_overridden : Error<
Expand All @@ -31,19 +31,19 @@ def note_module_cache_path : Note<
"after modifying system headers, please delete the module cache at '%0'">;

def err_ast_file_targetopt_mismatch : Error<
"AST file '%0' was compiled for the %1 '%2' but the current translation "
"precompiled file '%0' was compiled for the %1 '%2' but the current translation "
"unit is being compiled for target '%3'">;
def err_ast_file_targetopt_feature_mismatch : Error<
"%select{AST file '%1' was|current translation unit is}0 compiled with the target "
"feature '%2' but the %select{current translation unit is|AST file '%1' was}0 "
"%select{precompiled file '%1' was|current translation unit is}0 compiled with the target "
"feature '%2' but the %select{current translation unit is|precompiled file '%1' was}0 "
"not">;
def err_ast_file_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in "
"AST file '%3' but is currently %select{disabled|enabled}2">;
"precompiled file '%3' but is currently %select{disabled|enabled}2">;
def err_ast_file_langopt_value_mismatch : Error<
"%0 differs in AST file '%1' vs. current file">;
"%0 differs in precompiled file '%1' vs. current file">;
def err_ast_file_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
"the AST file '%1'">;
def err_ast_file_modulecache_mismatch : Error<"AST file '%2' was compiled with module cache "
"the precompiled file '%1'">;
def err_ast_file_modulecache_mismatch : Error<"precompiled file '%2' was compiled with module cache "
"path '%0', but the path is currently '%1'">;
def warn_pch_vfsoverlay_mismatch : Warning<
"PCH was compiled with different VFS overlay files than are currently in use">,
Expand All @@ -52,27 +52,27 @@ def note_pch_vfsoverlay_files : Note<"%select{PCH|current translation unit}0 has
def note_pch_vfsoverlay_empty : Note<"%select{PCH|current translation unit}0 has no VFS overlays">;

def err_ast_file_version_too_old : Error<
"%select{PCH|module|AST}0 file '%1' uses an older format that is no longer supported">;
"%select{PCH|module|precompiled}0 file '%1' uses an older format that is no longer supported">;
def err_ast_file_version_too_new : Error<
"%select{PCH|module|AST}0 file '%1' uses a newer format that cannot be read">;
"%select{PCH|module|precompiled }0 file '%1' uses a newer format that cannot be read">;
def err_ast_file_different_branch : Error<
"%select{PCH|module|AST}0 file '%1' built from a different branch (%2) than the compiler (%3)">;
"%select{PCH|module|precompiled}0 file '%1' built from a different branch (%2) than the compiler (%3)">;
def err_ast_file_with_compiler_errors : Error<
"%select{PCH|module|AST}0 file '%1' contains compiler errors">;
"%select{PCH|module|precompiled}0 file '%1' contains compiler errors">;

def err_module_file_conflict : Error<
"module '%0' is defined in both '%1' and '%2'">, DefaultFatal;
def err_ast_file_not_found : Error<
"%select{PCH|module|AST}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
"%select{PCH|module|precompiled}0 file '%1' not found%select{|: %3}2">, DefaultFatal;
def err_ast_file_out_of_date : Error<
"%select{PCH|module|AST}0 file '%1' is out of date and "
"%select{PCH|module|precompiled}0 file '%1' is out of date and "
"needs to be rebuilt%select{|: %3}2">, DefaultFatal;
def err_ast_file_invalid : Error<
"file '%1' is not a valid precompiled %select{PCH|module|AST}0 file: %2">, DefaultFatal;
"file '%1' is not a valid %select{PCH|module|precompiled}0 file: %2">, DefaultFatal;
def note_module_file_imported_by : Note<
"imported by %select{|module '%2' in }1'%0'">;
def err_module_file_not_module : Error<
"AST file '%0' was not built as a module">, DefaultFatal;
"precompiled file '%0' was not built as a module">, DefaultFatal;
def err_module_file_missing_top_level_submodule : Error<
"module file '%0' is missing its top-level submodule">, DefaultFatal;
def note_module_file_conflict : Note<
Expand All @@ -84,14 +84,14 @@ def remark_module_import : Remark<
InGroup<ModuleImport>;

def err_imported_module_not_found : Error<
"module '%0' in AST file '%1' %select{(imported by AST file '%2') |}4"
"module '%0' in precompiled file '%1' %select{(imported by precompiled file '%2') |}4"
"is not defined in any loaded module map file; "
"maybe you need to load '%3'?">, DefaultFatal;
def note_imported_by_pch_module_not_found : Note<
"consider adding '%0' to the header search path">;
def err_imported_module_modmap_changed : Error<
"module '%0' %select{in|imported by}4 AST file '%1' found in a different module map file"
" (%2) than when the importing AST file was built (%3)">, DefaultFatal;
"module '%0' %select{in|imported by}4 precompiled file '%1' found in a different module map file"
" (%2) than when the importing precompiled file was built (%3)">, DefaultFatal;
def err_imported_module_relocated : Error<
"module '%0' was built in directory '%1' but now resides in "
"directory '%2'">, DefaultFatal;
Expand All @@ -100,18 +100,18 @@ def err_module_different_modmap : Error<
"%select{| not}1 used when the module was built">;

def err_ast_file_macro_def_undef : Error<
"macro '%0' was %select{defined|undef'd}1 in the AST file '%2' but "
"macro '%0' was %select{defined|undef'd}1 in the precompiled file '%2' but "
"%select{undef'd|defined}1 on the command line">;
def err_ast_file_macro_def_conflict : Error<
"definition of macro '%0' differs between the AST file '%3' ('%1') "
"definition of macro '%0' differs between the precompiled file '%3' ('%1') "
"and the command line ('%2')">;
def err_ast_file_undef : Error<
"%select{command line contains|AST file '%1' was built with}0 "
"'-undef' but %select{AST file '%1' was not built with it|"
"%select{command line contains|precompiled file '%1' was built with}0 "
"'-undef' but %select{precompiled file '%1' was not built with it|"
"it is not present on the command line}0">;
def err_ast_file_pp_detailed_record : Error<
"%select{command line contains|AST file '%1' was built with}0 "
"'-detailed-preprocessing-record' but %select{AST file '%1' was not "
"%select{command line contains|precompiled file '%1' was built with}0 "
"'-detailed-preprocessing-record' but %select{precompiled file '%1' was not "
"built with it|it is not present on the command line}0">;

def err_module_odr_violation_missing_decl : Error<
Expand Down
11 changes: 6 additions & 5 deletions clang/lib/Serialization/ASTReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ bool ASTReader::ReadSpecializations(ModuleFile &M, BitstreamCursor &Cursor,
}

void ASTReader::Error(StringRef Msg) const {
Error(diag::err_fe_pch_malformed, Msg);
Error(diag::err_fe_ast_file_malformed, Msg);
if (PP.getLangOpts().Modules &&
!PP.getHeaderSearchInfo().getModuleCachePath().empty()) {
Diag(diag::note_module_cache_path)
Expand Down Expand Up @@ -4953,20 +4953,21 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName, ModuleKind Type,

static ASTFileSignature readASTFileSignature(StringRef PCH);

/// Whether \p Stream doesn't start with the AST/PCH file magic number 'CPCH'.
/// Whether \p Stream doesn't start with the AST file magic number 'CPCH'.
static llvm::Error doesntStartWithASTFileMagic(BitstreamCursor &Stream) {
// FIXME checking magic headers is done in other places such as
// SerializedDiagnosticReader and GlobalModuleIndex, but error handling isn't
// always done the same. Unify it all with a helper.
if (!Stream.canSkipToPos(4))
return llvm::createStringError(std::errc::illegal_byte_sequence,
"file too small to contain AST file magic");
return llvm::createStringError(
std::errc::illegal_byte_sequence,
"file too small to contain precompiled file magic");
for (unsigned C : {'C', 'P', 'C', 'H'})
if (Expected<llvm::SimpleBitstreamCursor::word_t> Res = Stream.Read(8)) {
if (Res.get() != C)
return llvm::createStringError(
std::errc::illegal_byte_sequence,
"file doesn't start with AST file magic");
"file doesn't start with precompiled file magic");
} else
return Res.takeError();
return llvm::Error::success();
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/check-for-sanitizer-feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
//
// Import the PCH without ASan enabled (we expect an error).
// RUN: not %clang_cc1 -x c -include-pch %t.asan_pch %s -verify 2>&1 | FileCheck %s --check-prefix=PCH_MISMATCH
// PCH_MISMATCH: AST file '{{.*}}.asan_pch' was compiled with the target feature '-fsanitize=address' but the current translation unit is not
// PCH_MISMATCH: precompiled file '{{.*}}.asan_pch' was compiled with the target feature '-fsanitize=address' but the current translation unit is not
//
// Emit a PCH with UBSan enabled.
// RUN: %clang_cc1 -x c -fsanitize=null %S/Inputs/check-for-sanitizer-feature/check.h -emit-pch -o %t.ubsan_pch
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Modules/cxx20-force-check-input.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ module;
export module a;
export using ::foo;

// CHECK-HEADER-FAILURE: fatal error:{{.*}}foo.h' has been modified since the AST file {{.*}}was built
// CHECK-FAILURE: fatal error:{{.*}}a.cppm' has been modified since the AST file {{.*}}was built
// CHECK-HEADER-FAILURE: fatal error:{{.*}}foo.h' has been modified since the precompiled file {{.*}}was built
// CHECK-FAILURE: fatal error:{{.*}}a.cppm' has been modified since the precompiled file {{.*}}was built
4 changes: 2 additions & 2 deletions clang/test/Modules/explicit-build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
// RUN: -fmodule-file=%t/a.pch \
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-A-AS-PCH %s
//
// CHECK-A-AS-PCH: fatal error: AST file '{{.*}}a.pch' was not built as a module
// CHECK-A-AS-PCH: fatal error: precompiled file '{{.*}}a.pch' was not built as a module

// -------------------------------
// Try to import a non-AST file with -fmodule-file=
Expand All @@ -164,7 +164,7 @@
// RUN: -fmodule-file=%t/not.pcm \
// RUN: %s 2>&1 | FileCheck --check-prefix=CHECK-BAD-FILE %s
//
// CHECK-BAD-FILE: fatal error: file '{{.*}}not.pcm' is not a valid precompiled module file: file too small to contain AST file magic
// CHECK-BAD-FILE: fatal error: file '{{.*}}not.pcm' is not a valid module file: file too small to contain precompiled file magic

// RUN: not %clang_cc1 -triple=x86_64-linux-gnu -x c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -Rmodule-build -fno-modules-error-recovery \
// RUN: -fmodule-file=%t/nonexistent.pcm \
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Modules/fatal-module-loader-error.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

#ifdef IMPLICIT

// expected-error@+1{{Module.pcm' is not a valid precompiled module file}}
// expected-error@+1{{Module.pcm' is not a valid module file}}
#import <Module/Module.h>
#pragma clang __debug crash;

#else

// expected-error@+1{{Module.pcm' is not a valid precompiled module file}}
// expected-error@+1{{Module.pcm' is not a valid module file}}
@import Module;
#pragma clang __debug crash;

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/ignored_macros.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// RUN: %clang_cc1 -fmodules-cache-path=%t.modules -fmodules -fimplicit-module-maps -I %S/Inputs -emit-pch -o %t.pch -x objective-c-header %s -verify
// RUN: not %clang_cc1 -fmodules-cache-path=%t.modules -DIGNORED=1 -fmodules -fimplicit-module-maps -I %S/Inputs -include-pch %t.pch %s > %t.err 2>&1
// RUN: FileCheck -check-prefix=CHECK-CONFLICT %s < %t.err
// CHECK-CONFLICT: AST file '{{.*}}' was compiled with module cache path
// CHECK-CONFLICT: precompiled file '{{.*}}' was compiled with module cache path

// Third trial: pass -DIGNORED=1 only to the second invocation, but
// make it ignored. There should be no failure, IGNORED is defined in
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/load_failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out

// FIXME: Clean up diagnostic text below and give it a location
// CHECK-FAILURE: error: C99 was disabled in AST file '{{.*}}load_failure.pcm' but is currently enabled
// CHECK-FAILURE: error: C99 was disabled in precompiled file '{{.*}}load_failure.pcm' but is currently enabled
// FIXME: When we have a syntax for modules in C, use that.


6 changes: 3 additions & 3 deletions clang/test/Modules/merge-target-features.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// RUN: -target-cpu i386 \
// RUN: -fsyntax-only merge-target-features.cpp 2>&1 \
// RUN: | FileCheck --check-prefix=SUBSET --implicit-check-not=error: %s
// SUBSET: error: AST file '{{.*}}foo.pcm' was compiled with the target feature '+sse2' but the current translation unit is not
// SUBSET: error: precompiled file '{{.*}}foo.pcm' was compiled with the target feature '+sse2' but the current translation unit is not
// SUBSET: error: {{.*}} configuration mismatch
//
// RUN: %clang_cc1 -fmodules -x c++ -fmodules-cache-path=%t \
Expand Down Expand Up @@ -57,8 +57,8 @@
// RUN: -target-cpu i386 -target-feature +cx16 \
// RUN: -fsyntax-only merge-target-features.cpp 2>&1 \
// RUN: | FileCheck --check-prefix=MISMATCH --implicit-check-not=error: %s
// MISMATCH: error: AST file '{{.*}}foo.pcm' was compiled with the target feature '+sse2' but the current translation unit is not
// MISMATCH: error: current translation unit is compiled with the target feature '+cx16' but the AST file '{{.*}}foo.pcm' was not
// MISMATCH: error: precompiled file '{{.*}}foo.pcm' was compiled with the target feature '+sse2' but the current translation unit is not
// MISMATCH: error: current translation unit is compiled with the target feature '+cx16' but the precompiled file '{{.*}}foo.pcm' was not
// MISMATCH: error: {{.*}} configuration mismatch

#include "foo.h"
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/mismatch-diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ export module mismatching_module;

//--- use.cpp
import mismatching_module;
// CHECK: error: POSIX thread support was enabled in AST file '{{.*[/|\\\\]}}mismatching_module.pcm' but is currently disabled
// CHECK: error: POSIX thread support was enabled in precompiled file '{{.*[/|\\\\]}}mismatching_module.pcm' but is currently disabled
// CHECK-NEXT: module file {{.*[/|\\\\]}}mismatching_module.pcm cannot be loaded due to a configuration mismatch with the current compilation
2 changes: 1 addition & 1 deletion clang/test/Modules/module-imported-by-pch-path.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ void test() {
(void)MyModuleVersion; // should be found by implicit import
}

// CHECK: module 'MyModule' in AST file '{{.*MyModule.*pcm}}' (imported by AST file '[[PCH:.*header.pch]]') is not defined in any loaded module map file; maybe you need to load '[[PATH:.*folder-with-modulemap]]
// CHECK: module 'MyModule' in precompiled file '{{.*MyModule.*pcm}}' (imported by precompiled file '[[PCH:.*header.pch]]') is not defined in any loaded module map file; maybe you need to load '[[PATH:.*folder-with-modulemap]]
// CHECK: consider adding '[[PATH]]' to the header search path
// CHECK: imported by '[[PCH]]'
4 changes: 2 additions & 2 deletions clang/test/Modules/module-pch-different-cache-path.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

pch_int x = 0;

// CHECK-ERROR: AST file '{{.*}}' was compiled with module cache path '{{.*}}', but the path is currently '{{.*}}'
// CHECK-SUCCESS-NOT: AST file '{{.*}}' was compiled with module cache path '{{.*}}', but the path is currently '{{.*}}'
// CHECK-ERROR: precompiled file '{{.*}}' was compiled with module cache path '{{.*}}', but the path is currently '{{.*}}'
// CHECK-SUCCESS-NOT: precompiled file '{{.*}}' was compiled with module cache path '{{.*}}', but the path is currently '{{.*}}'
4 changes: 2 additions & 2 deletions clang/test/Modules/pr62359.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int use() {
return 0;
}

// CHECK: OpenMP{{.*}}differs in AST file '{{.*}}Hello.pcm' vs. current file
// CHECK: OpenMP{{.*}}differs in precompiled file '{{.*}}Hello.pcm' vs. current file

//--- use2.cpp
// expected-no-diagnostics
Expand All @@ -55,5 +55,5 @@ int use2() {
return 0;
}

// CHECK: OpenMP{{.*}}differs in AST file '{{.*}}Hello.pcm' vs. current file
// CHECK: OpenMP{{.*}}differs in precompiled file '{{.*}}Hello.pcm' vs. current file
// CHECK: use of undeclared identifier 'pragma'
4 changes: 2 additions & 2 deletions clang/test/Modules/resolution-change.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

// Use the PCH with no way to resolve DependsOnA
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-NODOA %s
// CHECK-NODOA: module 'DependsOnA' in AST file '{{.*DependsOnA.*pcm}}' (imported by AST file '{{.*A.pch}}') is not defined in any loaded module map
// CHECK-NODOA: module 'DependsOnA' in precompiled file '{{.*DependsOnA.*pcm}}' (imported by precompiled file '{{.*A.pch}}') is not defined in any loaded module map

// Use the PCH with no way to resolve A
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-NOA %s
// CHECK-NOA: module 'A' in AST file '{{.*A.*pcm}}' (imported by AST file '{{.*DependsOnA.*pcm}}') is not defined in any loaded module map
// CHECK-NOA: module 'A' in precompiled file '{{.*A.*pcm}}' (imported by precompiled file '{{.*DependsOnA.*pcm}}') is not defined in any loaded module map

// Use the PCH and have it resolve to the other A
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/modules-with-same-name/DependsOnA -I %S/Inputs/modules-with-same-name/path2/A -include-pch %t-A.pch %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-WRONGA %s
Expand Down
5 changes: 3 additions & 2 deletions clang/test/PCH/arc.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// REQUIRES: x86-registered-target
// Test this without pch.

// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include %S/Inputs/arc.h -emit-llvm-only %s

// Test with pch.
Expand All @@ -14,5 +15,5 @@
array0 a0;
array1 a1;

// CHECK-ERR1: Objective-C automated reference counting was enabled in AST file '{{.*}}' but is currently disabled
// CHECK-ERR2: Objective-C automated reference counting was disabled in AST file '{{.*}}' but is currently enabled
// CHECK-ERR1: Objective-C automated reference counting was enabled in precompiled file '{{.*}}' but is currently disabled
// CHECK-ERR2: Objective-C automated reference counting was disabled in precompiled file '{{.*}}' but is currently enabled
6 changes: 3 additions & 3 deletions clang/test/PCH/fuzzy-pch.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ BAR bar = 17;
# error BAR was not defined
#endif

// CHECK-FOO: definition of macro 'FOO' differs between the AST file '{{.*}}' ('1') and the command line ('blah')
// CHECK-NOFOO: macro 'FOO' was defined in the AST file '{{.*}}' but undef'd on the command line
// CHECK-FOO: definition of macro 'FOO' differs between the precompiled file '{{.*}}' ('1') and the command line ('blah')
// CHECK-NOFOO: macro 'FOO' was defined in the precompiled file '{{.*}}' but undef'd on the command line

// CHECK-UNDEF: command line contains '-undef' but AST file '{{.*}}' was not built with it
// CHECK-UNDEF: command line contains '-undef' but precompiled file '{{.*}}' was not built with it

2 changes: 1 addition & 1 deletion clang/test/PCH/module-hash-difference.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
// RUN: not %clang_cc1 -fsyntax-only -include-pch %t.pch %s -I %S/Inputs/modules -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash 2> %t.err
// RUN: FileCheck -input-file=%t.err %s

// CHECK: error: AST file '{{.*}}' was compiled with module cache path {{.*}}, but the path is currently {{.*}}
// CHECK: error: precompiled file '{{.*}}' was compiled with module cache path {{.*}}, but the path is currently {{.*}}
@import Foo;
4 changes: 2 additions & 2 deletions clang/test/PCH/ms-pch-macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BAR bar = 17;
# error BAR was not defined
#endif

// CHECK-FOO: definition of macro 'FOO' differs between the AST file '{{.*}}1.pch' ('1') and the command line ('blah')
// CHECK-NOFOO: macro 'FOO' was defined in the AST file '{{.*}}1.pch' but undef'd on the command line
// CHECK-FOO: definition of macro 'FOO' differs between the precompiled file '{{.*}}1.pch' ('1') and the command line ('blah')
// CHECK-NOFOO: macro 'FOO' was defined in the precompiled file '{{.*}}1.pch' but undef'd on the command line

// expected-warning@2 {{definition of macro 'BAR' does not match definition in precompiled header}}
Loading