Skip to content

Commit 99de065

Browse files
committed
Revert "[Serialization] Downgrade inconsistent flags from erros to warnings (#115416)"
This reverts commit 74449ab. See the post commit message in #115416
1 parent 4a7dbed commit 99de065

13 files changed

+65
-86
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,6 @@ Improvements to Clang's diagnostics
590590

591591
- Fixed a false negative ``-Wunused-private-field`` diagnostic when a defaulted comparison operator is defined out of class (#GH116961).
592592

593-
- Clang now downgrades the inconsistent language options between modules to warnings instead of errors.
594-
595593
Improvements to Clang's time-trace
596594
----------------------------------
597595

clang/include/clang/Basic/DiagnosticGroups.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ def ModuleLock : DiagGroup<"module-lock">;
557557
def ModuleBuild : DiagGroup<"module-build">;
558558
def ModuleImport : DiagGroup<"module-import">;
559559
def ModuleConflict : DiagGroup<"module-conflict">;
560-
def ModuleMismatchedOption : DiagGroup<"module-mismatched-option">;
561560
def ModuleFileExtension : DiagGroup<"module-file-extension">;
562561
def ModuleIncludeDirectiveTranslation : DiagGroup<"module-include-translation">;
563562
def RoundTripCC1Args : DiagGroup<"round-trip-cc1-args">;

clang/include/clang/Basic/DiagnosticSerializationKinds.td

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ def err_ast_file_targetopt_feature_mismatch : Error<
3636
"%select{AST file '%1' was|current translation unit is}0 compiled with the target "
3737
"feature '%2' but the %select{current translation unit is|AST file '%1' was}0 "
3838
"not">;
39-
def warn_ast_file_langopt_mismatch : Warning<"%0 was %select{disabled|enabled}1 in "
40-
"AST file '%3' but is currently %select{disabled|enabled}2">,
41-
InGroup<ModuleMismatchedOption>;
42-
def warn_ast_file_langopt_value_mismatch : Warning<
43-
"%0 differs in AST file '%1' vs. current file">,
44-
InGroup<ModuleMismatchedOption>;
39+
def err_ast_file_langopt_mismatch : Error<"%0 was %select{disabled|enabled}1 in "
40+
"AST file '%3' but is currently %select{disabled|enabled}2">;
41+
def err_ast_file_langopt_value_mismatch : Error<
42+
"%0 differs in AST file '%1' vs. current file">;
4543
def err_ast_file_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
4644
"the AST file '%1'">;
4745
def err_ast_file_modulecache_mismatch : Error<"AST file '%2' was compiled with module cache "

clang/lib/Serialization/ASTReader.cpp

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ ASTReaderListener::~ASTReaderListener() = default;
279279
/// \param Diags If non-NULL, diagnostics will be emitted via this engine.
280280
/// \param AllowCompatibleDifferences If true, differences between compatible
281281
/// language options will be permitted.
282-
static void checkLanguageOptions(const LangOptions &LangOpts,
282+
///
283+
/// \returns true if the languagae options mis-match, false otherwise.
284+
static bool checkLanguageOptions(const LangOptions &LangOpts,
283285
const LangOptions &ExistingLangOpts,
284286
StringRef ModuleFilename,
285287
DiagnosticsEngine *Diags,
@@ -288,27 +290,30 @@ static void checkLanguageOptions(const LangOptions &LangOpts,
288290
if (ExistingLangOpts.Name != LangOpts.Name) { \
289291
if (Diags) { \
290292
if (Bits == 1) \
291-
Diags->Report(diag::warn_ast_file_langopt_mismatch) \
293+
Diags->Report(diag::err_ast_file_langopt_mismatch) \
292294
<< Description << LangOpts.Name << ExistingLangOpts.Name \
293295
<< ModuleFilename; \
294296
else \
295-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch) \
297+
Diags->Report(diag::err_ast_file_langopt_value_mismatch) \
296298
<< Description << ModuleFilename; \
297299
} \
300+
return true; \
298301
}
299302

300303
#define VALUE_LANGOPT(Name, Bits, Default, Description) \
301304
if (ExistingLangOpts.Name != LangOpts.Name) { \
302305
if (Diags) \
303-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch) \
306+
Diags->Report(diag::err_ast_file_langopt_value_mismatch) \
304307
<< Description << ModuleFilename; \
308+
return true; \
305309
}
306310

307311
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
308312
if (ExistingLangOpts.get##Name() != LangOpts.get##Name()) { \
309313
if (Diags) \
310-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch) \
314+
Diags->Report(diag::err_ast_file_langopt_value_mismatch) \
311315
<< Description << ModuleFilename; \
316+
return true; \
312317
}
313318

314319
#define COMPATIBLE_LANGOPT(Name, Bits, Default, Description) \
@@ -330,21 +335,24 @@ static void checkLanguageOptions(const LangOptions &LangOpts,
330335

331336
if (ExistingLangOpts.ModuleFeatures != LangOpts.ModuleFeatures) {
332337
if (Diags)
333-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch)
338+
Diags->Report(diag::err_ast_file_langopt_value_mismatch)
334339
<< "module features" << ModuleFilename;
340+
return true;
335341
}
336342

337343
if (ExistingLangOpts.ObjCRuntime != LangOpts.ObjCRuntime) {
338344
if (Diags)
339-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch)
345+
Diags->Report(diag::err_ast_file_langopt_value_mismatch)
340346
<< "target Objective-C runtime" << ModuleFilename;
347+
return true;
341348
}
342349

343350
if (ExistingLangOpts.CommentOpts.BlockCommandNames !=
344351
LangOpts.CommentOpts.BlockCommandNames) {
345352
if (Diags)
346-
Diags->Report(diag::warn_ast_file_langopt_value_mismatch)
353+
Diags->Report(diag::err_ast_file_langopt_value_mismatch)
347354
<< "block command names" << ModuleFilename;
355+
return true;
348356
}
349357

350358
// Sanitizer feature mismatches are treated as compatible differences. If
@@ -370,8 +378,11 @@ static void checkLanguageOptions(const LangOptions &LangOpts,
370378
}
371379
#include "clang/Basic/Sanitizers.def"
372380
}
381+
return true;
373382
}
374383
}
384+
385+
return false;
375386
}
376387

377388
/// Compare the given set of target options against an existing set of
@@ -448,10 +459,9 @@ bool PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts,
448459
StringRef ModuleFilename, bool Complain,
449460
bool AllowCompatibleDifferences) {
450461
const LangOptions &ExistingLangOpts = PP.getLangOpts();
451-
checkLanguageOptions(LangOpts, ExistingLangOpts, ModuleFilename,
452-
Complain ? &Reader.Diags : nullptr,
453-
AllowCompatibleDifferences);
454-
return false;
462+
return checkLanguageOptions(LangOpts, ExistingLangOpts, ModuleFilename,
463+
Complain ? &Reader.Diags : nullptr,
464+
AllowCompatibleDifferences);
455465
}
456466

457467
bool PCHValidator::ReadTargetOptions(const TargetOptions &TargetOpts,
@@ -5388,9 +5398,8 @@ namespace {
53885398
bool ReadLanguageOptions(const LangOptions &LangOpts,
53895399
StringRef ModuleFilename, bool Complain,
53905400
bool AllowCompatibleDifferences) override {
5391-
checkLanguageOptions(ExistingLangOpts, LangOpts, ModuleFilename, nullptr,
5392-
AllowCompatibleDifferences);
5393-
return false;
5401+
return checkLanguageOptions(ExistingLangOpts, LangOpts, ModuleFilename,
5402+
nullptr, AllowCompatibleDifferences);
53945403
}
53955404

53965405
bool ReadTargetOptions(const TargetOptions &TargetOpts,

clang/test/Modules/explicit-build-missing-files.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/b.pcm %s
3434
// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s --check-prefix=MISSING-B
3535
// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm -fmodule-map-file=%t/modulemap.moved %s
36-
// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm -fmodule-map-file=%t/modulemap.moved -std=c++1z %s
36+
// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm -fmodule-map-file=%t/modulemap.moved -std=c++1z %s
3737
// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm -fmodule-map-file=%t/modulemap.moved -std=c++1z -Wno-module-file-config-mismatch %s -Db=a
3838
// RUN: rm %t/a.h
3939
// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -verify

clang/test/Modules/load_failure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DNONEXISTENT 2>&1 | FileCheck -check-prefix=CHECK-NONEXISTENT %s
1212
// CHECK-NONEXISTENT: load_failure.c:2:9: fatal error: module 'load_nonexistent' not found
1313

14-
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DFAILURE 2> %t.out
15-
// RUN: FileCheck -check-prefix=CHECK-WARN %s < %t.out
14+
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -x objective-c -fmodules-cache-path=%t -I %S/Inputs -fdisable-module-hash %s -DFAILURE 2> %t.out
15+
// RUN: FileCheck -check-prefix=CHECK-FAILURE %s < %t.out
1616

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

2121

clang/test/Modules/mismatch-diagnostics.cpp

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,31 @@
33
// RUN: split-file %s %t
44
// RUN: mkdir -p %t/prebuilt_modules
55
//
6-
// RUN: %clang_cc1 -triple %itanium_abi_triple \
7-
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
8-
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
9-
// RUN: %t/mismatching_module.cppm -o \
6+
// RUN: %clang_cc1 -triple %itanium_abi_triple \
7+
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
8+
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
9+
// RUN: %t/mismatching_module.cppm -o \
1010
// RUN: %t/prebuilt_modules/mismatching_module.pcm
1111
//
12-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
13-
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
14-
// RUN: %t/use.cpp 2>&1 | FileCheck %t/use.cpp
12+
// RUN: not %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
13+
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
14+
// RUN: %t/use.cpp 2>&1 | FileCheck %s
1515

1616
// Test again with reduced BMI.
17-
// RUN: %clang_cc1 -triple %itanium_abi_triple \
18-
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
19-
// RUN: -emit-reduced-module-interface -pthread -DBUILD_MODULE \
20-
// RUN: %t/mismatching_module.cppm -o \
17+
// RUN: %clang_cc1 -triple %itanium_abi_triple \
18+
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
19+
// RUN: -emit-reduced-module-interface -pthread -DBUILD_MODULE \
20+
// RUN: %t/mismatching_module.cppm -o \
2121
// RUN: %t/prebuilt_modules/mismatching_module.pcm
2222
//
23-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
24-
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
25-
// RUN: %t/use.cpp 2>&1 | FileCheck %t/use.cpp
26-
//
27-
// RUN: %clang_cc1 -triple %itanium_abi_triple \
28-
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
29-
// RUN: -emit-module-interface -pthread -DBUILD_MODULE \
30-
// RUN: %t/mismatching_module.cppm -o \
31-
// RUN: %t/prebuilt_modules/mismatching_module.pcm
32-
//
33-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
34-
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
35-
// RUN: -Wno-module-mismatched-option %t/use.cpp 2>&1 | FileCheck %t/use.cpp \
36-
// RUN: --check-prefix=NOWARN --allow-empty
37-
38-
// Test again with reduced BMI.
39-
// RUN: %clang_cc1 -triple %itanium_abi_triple \
40-
// RUN: -std=c++20 -fprebuilt-module-path=%t/prebuilt-modules \
41-
// RUN: -emit-reduced-module-interface -pthread -DBUILD_MODULE \
42-
// RUN: %t/mismatching_module.cppm -o \
43-
// RUN: %t/prebuilt_modules/mismatching_module.pcm
44-
//
45-
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
46-
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
47-
// RUN: -Wno-module-mismatched-option %t/use.cpp 2>&1 | FileCheck %t/use.cpp \
48-
// RUN: --check-prefix=NOWARN --allow-empty
23+
// RUN: not %clang_cc1 -triple %itanium_abi_triple -std=c++20 \
24+
// RUN: -fprebuilt-module-path=%t/prebuilt_modules -DCHECK_MISMATCH \
25+
// RUN: %t/use.cpp 2>&1 | FileCheck %s
4926

5027
//--- mismatching_module.cppm
5128
export module mismatching_module;
5229

5330
//--- use.cpp
5431
import mismatching_module;
55-
// CHECK: warning: POSIX thread support was enabled in AST file '{{.*[/|\\\\]}}mismatching_module.pcm' but is currently disabled
56-
57-
// NOWARN-NOT: warning
32+
// CHECK: error: POSIX thread support was enabled in AST file '{{.*[/|\\\\]}}mismatching_module.pcm' but is currently disabled
33+
// CHECK-NEXT: module file {{.*[/|\\\\]}}mismatching_module.pcm cannot be loaded due to a configuration mismatch with the current compilation

clang/test/Modules/module-feature.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -fmodule-feature f2 -fmodule-feature f1 -F %S/Inputs %s -Rmodule-build 2>&1 | FileCheck %s -allow-empty -check-prefix=ALREADY_BUILT
77
// ALREADY_BUILT-NOT: building module
88

9-
// Warns if we try to force the load.
9+
// Errors if we try to force the load.
1010
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.nohash -fimplicit-module-maps -fdisable-module-hash -fmodule-feature f1 -fmodule-feature f2 -F %S/Inputs %s -verify -Rmodule-build
11-
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t.nohash -fimplicit-module-maps -fdisable-module-hash -fmodule-feature f2 -F %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=DIFFERS
12-
// DIFFERS: warning: module features differs
11+
// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t.nohash -fimplicit-module-maps -fdisable-module-hash -fmodule-feature f2 -F %S/Inputs %s 2>&1 | FileCheck %s -check-prefix=DIFFERS
12+
// DIFFERS: error: module features differs
1313

1414
@import Module; // expected-remark {{building module 'Module'}} expected-remark {{finished}}

clang/test/Modules/pr62359.cppm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// RUN: split-file %s %t
44
//
55
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm
6-
// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
6+
// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
77
// RUN: 2>&1 | FileCheck %t/use.cpp
8-
// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
8+
// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
99
// RUN: 2>&1 | FileCheck %t/use2.cpp
1010
//
1111
// RUN: %clang_cc1 -std=c++20 -fopenmp -emit-module-interface %t/Hello.cppm -o %t/Hello.pcm
@@ -18,9 +18,9 @@
1818
// RUN: split-file %s %t
1919
//
2020
// RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/Hello.cppm -o %t/Hello.pcm
21-
// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
21+
// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
2222
// RUN: 2>&1 | FileCheck %t/use.cpp
23-
// RUN: %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
23+
// RUN: not %clang_cc1 -std=c++20 -fopenmp %t/use2.cpp -fmodule-file=hello=%t/Hello.pcm -fsyntax-only \
2424
// RUN: 2>&1 | FileCheck %t/use2.cpp
2525
//
2626
// RUN: %clang_cc1 -std=c++20 -fopenmp -emit-reduced-module-interface %t/Hello.cppm -o %t/Hello.pcm
@@ -56,3 +56,4 @@ int use2() {
5656
}
5757

5858
// CHECK: OpenMP{{.*}}differs in AST file '{{.*}}Hello.pcm' vs. current file
59+
// CHECK: use of undeclared identifier 'pragma'

clang/test/Modules/prebuilt-implicit-modules.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// RUN: mkdir -p %t2
2626
// RUN: %clang_cc1 -x objective-c -fmodules %S/Inputs/prebuilt-implicit-module/module.modulemap -emit-module -fmodule-name=module_a -fmodules-cache-path=%t
2727
// RUN: %clang_cc1 -x objective-c -fmodules %S/Inputs/prebuilt-implicit-module/module.modulemap -emit-module -fmodule-name=module_a -o %t/module_a.pcm -fno-signed-char
28-
// RUN: %clang_cc1 -x objective-c %s -I%S/Inputs/prebuilt-implicit-module -fmodules -fmodule-map-file=%S/Inputs/prebuilt-implicit-module/module.modulemap -fprebuilt-implicit-modules -fprebuilt-module-path=%t -fmodules-cache-path=%t2
28+
// RUN: not %clang_cc1 -x objective-c %s -I%S/Inputs/prebuilt-implicit-module -fmodules -fmodule-map-file=%S/Inputs/prebuilt-implicit-module/module.modulemap -fprebuilt-implicit-modules -fprebuilt-module-path=%t -fmodules-cache-path=%t2
2929
// RUN: find %t2 -name "module_a*.pcm" | not grep module_a
3030

3131
// expected-no-diagnostics

clang/test/PCH/arc.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -x objective-c-header -o %t %S/Inputs/arc.h
77
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -emit-llvm-only %s
88

9-
// Test warning when pch's -fobjc-arc state is different.
10-
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR1 %s
9+
// Test error when pch's -fobjc-arc state is different.
10+
// RUN: not %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -include-pch %t -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR1 %s
1111
// RUN: %clang_cc1 -emit-pch -fblocks -triple x86_64-apple-darwin11 -x objective-c-header -o %t %S/Inputs/arc.h
12-
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR2 %s
12+
// RUN: not %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include-pch %t -emit-llvm-only %s 2>&1 | FileCheck -check-prefix=CHECK-ERR2 %s
1313

1414
array0 a0;
1515
array1 a1;

clang/test/PCH/no-validate-pch.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// CHECK: note: previous definition is here
1717
// CHECK: #define X 4
1818

19-
// CHECK-VAL: warning: __OPTIMIZE__ predefined macro was enabled in AST file '{{.*}}' but is currently disabled
19+
// CHECK-VAL: error: __OPTIMIZE__ predefined macro was enabled in AST file '{{.*}}' but is currently disabled
2020
// CHECK-VAL: error: definition of macro 'X' differs between the AST file '{{.*}}' ('4') and the command line ('5')
2121

2222
void test(void) {

clang/test/PCH/pch-dir.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
// RUN: %clang -x c++ -include %t.h -std=c++98 -fsyntax-only %s -Xclang -print-stats 2> %t.cpplog
1212
// RUN: FileCheck -check-prefix=CHECK-CPP %s < %t.cpplog
1313

14-
// RUN: %clang -x c++ -std=c++11 -include %t.h -fsyntax-only %s 2> %t.cpp11log
15-
// RUN: FileCheck %s --check-prefix=CHECK-OPT-DIFF < %t.cpp11log
14+
// RUN: not %clang -x c++ -std=c++11 -include %t.h -fsyntax-only %s 2> %t.cpp11log
15+
// RUN: FileCheck -check-prefix=CHECK-NO-SUITABLE %s < %t.cpp11log
1616

17-
// RUN: %clang -include %t.h -fsyntax-only %s 2> %t.missinglog2
18-
// RUN: FileCheck --check-prefix=CHECK-OPT-DIFF %s < %t.missinglog2
17+
// RUN: not %clang -include %t.h -fsyntax-only %s 2> %t.missinglog2
18+
// RUN: FileCheck -check-prefix=CHECK-NO-SUITABLE %s < %t.missinglog2
1919
// RUN: not %clang -include %t.h -DFOO=foo -DBAR=bar -fsyntax-only %s 2> %t.missinglog2
2020
// RUN: FileCheck -check-prefix=CHECK-NO-SUITABLE %s < %t.missinglog2
2121

@@ -41,8 +41,6 @@ int get(void) {
4141
#endif
4242
}
4343

44-
// CHECK-OPT-DIFF: warning: {{.*}} was disabled in AST file{{.*}} but is currently enabled
45-
4644
// CHECK-NO-SUITABLE: no suitable precompiled header file found in directory
4745

4846
// CHECK-IGNORED-DIR: precompiled header directory '{{.*}}pch-dir.c.tmp.x.h.gch' was ignored because it contains no clang PCH files

0 commit comments

Comments
 (0)