================
@@ -0,0 +1,162 @@
+// RUN: rm -rf %t && split-file %s %t
+// RUN: not %clang_cc1 -fsyntax-only -fapinotes %t/diagnostics.cpp -I 
%t/WhereParametersDuplicateSelectorDiag 2>&1 | FileCheck 
%t/WhereParametersDuplicateSelectorDiag/APINotes.apinotes 
--check-prefix=DUPLICATE
+// RUN: rm -rf %t/ModulesCache && mkdir -p %t/ModulesCache
+// RUN: rm -rf %t/PragmaModulesCache && mkdir -p %t/PragmaModulesCache
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/PragmaModulesCache -fdisable-module-hash 
-fapinotes-modules -Wapinotes -fsyntax-only -I %t/WhereParametersPragmaDiag 
%t/pragma-diagnostics.cpp -x c++ 2>&1 | count 0
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wapinotes -fsyntax-only -I 
%S/Inputs/Headers %t/diagnostics.cpp -x c++ 2>&1 | FileCheck %s 
--check-prefix=UNMATCHED --implicit-check-not=diagnosticMatchedGlobal 
--implicit-check-not=diagnosticAliasMatchedGlobal 
--implicit-check-not=diagnosticMatchedMethod 
--implicit-check-not=diagnosticAliasMatchedMethod
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter diagnosticBroadGlobal -x c++ | 
FileCheck %s --check-prefix=BROAD-GLOBAL
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter 
DiagnosticWidget::diagnosticBroadMethod -x c++ | FileCheck %s 
--check-prefix=BROAD-METHOD
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter diagnosticMatchedGlobal -x c++ | 
FileCheck %s --check-prefix=MATCHED-GLOBAL
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter diagnosticAliasMatchedGlobal -x 
c++ | FileCheck %s --check-prefix=ALIAS-MATCHED-GLOBAL
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter 
DiagnosticWidget::diagnosticMatchedMethod -x c++ | FileCheck %s 
--check-prefix=MATCHED-METHOD
+// RUN: %clang_cc1 -fmodules -fimplicit-module-maps 
-fmodules-cache-path=%t/ModulesCache/WhereParametersDiagnostics 
-fdisable-module-hash -fapinotes-modules -Wno-apinotes -I %S/Inputs/Headers 
%t/diagnostics.cpp -ast-dump -ast-dump-filter 
DiagnosticWidget::diagnosticAliasMatchedMethod -x c++ | FileCheck %s 
--check-prefix=ALIAS-MATCHED-METHOD
+
+
+// UNMATCHED-DAG: warning: API notes entry for 'unmatchedGlobal' has unmatched 
Where.Parameters [int]
----------------
j-hui wrote:

nit: I think you can put this check into the YAML file itself (using `#` as the 
comment leader) so that the check statement is closer to what is being matched

https://github.com/llvm/llvm-project/pull/209408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to