[clang] 0c21705 - [analysis][NFC] clean unittest log (#123758)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 07:04:17 PST 2025


Author: Congcong Cai
Date: 2025-01-21T23:04:13+08:00
New Revision: 0c217058fce0ffdbbd406ccf598a888e44178277

URL: https://github.com/llvm/llvm-project/commit/0c217058fce0ffdbbd406ccf598a888e44178277
DIFF: https://github.com/llvm/llvm-project/commit/0c217058fce0ffdbbd406ccf598a888e44178277.diff

LOG: [analysis][NFC] clean unittest log (#123758)

1. clean llvm::errs ouput
2. add -Wno-everything option to suppress clang warning during test

Added: 
    

Modified: 
    clang/unittests/Analysis/CFGBuildResult.h
    clang/unittests/Analysis/CFGTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Analysis/CFGBuildResult.h b/clang/unittests/Analysis/CFGBuildResult.h
index 72ad1cc7ce4011..0d5539005840dc 100644
--- a/clang/unittests/Analysis/CFGBuildResult.h
+++ b/clang/unittests/Analysis/CFGBuildResult.h
@@ -65,8 +65,8 @@ class CFGCallback : public ast_matchers::MatchFinder::MatchCallback {
 template <typename FuncMatcherT = ast_matchers::internal::TrueMatcher>
 BuildResult BuildCFG(const char *Code, CFG::BuildOptions Options = {},
                      FuncMatcherT FuncMatcher = ast_matchers::anything()) {
-  std::vector<std::string> Args = {"-std=c++11",
-                                   "-fno-delayed-template-parsing"};
+  const std::vector<std::string> Args = {
+      "-std=c++11", "-fno-delayed-template-parsing", "-Wno-everything"};
   std::unique_ptr<ASTUnit> AST = tooling::buildASTFromCodeWithArgs(Code, Args);
   if (!AST)
     return BuildResult::ToolFailed;

diff  --git a/clang/unittests/Analysis/CFGTest.cpp b/clang/unittests/Analysis/CFGTest.cpp
index 2b27da00814250..46a6751391cf58 100644
--- a/clang/unittests/Analysis/CFGTest.cpp
+++ b/clang/unittests/Analysis/CFGTest.cpp
@@ -195,7 +195,6 @@ TEST(CFG, ElementRefIterator) {
   // Reverse, non-const version
   Index = MainBlockSize;
   for (CFGBlock::CFGElementRef ElementRef : MainBlock->rrefs()) {
-    llvm::errs() << Index << '\n';
     EXPECT_EQ(ElementRef.getParent(), MainBlock);
     EXPECT_EQ(ElementRef.getIndexInBlock(), Index);
     EXPECT_TRUE(ElementRef->getAs<CFGStmt>());


        


More information about the cfe-commits mailing list