Skip to content

Commit 6ad4ed5

Browse files
[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.
1 parent 0c02b2e commit 6ad4ed5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/unittests/Analysis/ReplaceWithVecLibTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ class ReplaceWithVecLibTest : public ::testing::Test {
7272
PB.registerFunctionAnalyses(FAM);
7373

7474
// Enable debugging and capture std error
75+
bool DebugFlagPrev = llvm::DebugFlag;
7576
llvm::DebugFlag = true;
7677
testing::internal::CaptureStderr();
7778
FPM.run(*M->getFunction("foo"), FAM);
79+
llvm::DebugFlag = DebugFlagPrev;
7880
return getLastLine(testing::internal::GetCapturedStderr());
7981
}
8082
};

0 commit comments

Comments
 (0)