File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,25 @@ TEST_F(SuppressionMappingTest, LongestMatchWins) {
314314 locForFile (" clang/lib/Sema/foo.h" )));
315315}
316316
317+ TEST_F (SuppressionMappingTest, LongShortMatch) {
318+ llvm::StringLiteral SuppressionMappingFile = R"(
319+ [unused]
320+ src:*test/*
321+ src:*lld/*=emit)" ;
322+ Diags.getDiagnosticOptions ().DiagnosticSuppressionMappingsFile = " foo.txt" ;
323+ FS->addFile (" foo.txt" , /* ModificationTime=*/ {},
324+ llvm::MemoryBuffer::getMemBuffer (SuppressionMappingFile));
325+ clang::ProcessWarningOptions (Diags, Diags.getDiagnosticOptions (), *FS);
326+ EXPECT_THAT (diags (), IsEmpty ());
327+
328+ EXPECT_TRUE (Diags.isSuppressedViaMapping (diag::warn_unused_function,
329+ locForFile (" test/my_test1.cpp" )));
330+
331+ // FIXME: This is confusing.
332+ EXPECT_TRUE (Diags.isSuppressedViaMapping (diag::warn_unused_function,
333+ locForFile (" lld/test/my_test2.cpp" )));
334+ }
335+
317336TEST_F (SuppressionMappingTest, IsIgnored) {
318337 llvm::StringLiteral SuppressionMappingFile = R"(
319338 [unused]
You can’t perform that action at this time.
0 commit comments