diff options
author | Paschalis Mpeis <paschalis.mpeis@arm.com> | 2024-01-23 15:57:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 15:57:19 +0000 |
commit | 6ad4ed5f1dd0a8160cd3c7b75e63a0e2f6061b5b (patch) | |
tree | 1cdeb498d659a5e1896d318b9a8e53734fac824f | |
parent | 0c02b2e0e0397b5d73dc4c8cc10561f05789ee41 (diff) | |
download | llvm-6ad4ed5f1dd0a8160cd3c7b75e63a0e2f6061b5b.zip llvm-6ad4ed5f1dd0a8160cd3c7b75e63a0e2f6061b5b.tar.gz llvm-6ad4ed5f1dd0a8160cd3c7b75e63a0e2f6061b5b.tar.bz2 |
[VecLib] Fix: Restore DebugFlag state in ReplaceWithVecLibTest (#78989)
It appears that Google Tests run multiple modules from the same
invocation.
As a result setting `llvm::DebugFlag` in this pass kept it on in
subsequent passes, which is not the expected behavior.
-rw-r--r-- | llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp b/llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp index a1f0a4a..95f17f9 100644 --- a/llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp +++ b/llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp @@ -72,9 +72,11 @@ protected: PB.registerFunctionAnalyses(FAM); // Enable debugging and capture std error + bool DebugFlagPrev = llvm::DebugFlag; llvm::DebugFlag = true; testing::internal::CaptureStderr(); FPM.run(*M->getFunction("foo"), FAM); + llvm::DebugFlag = DebugFlagPrev; return getLastLine(testing::internal::GetCapturedStderr()); } }; |