Skip to content

Commit

Permalink
Add print on error to debug the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbs96 committed Dec 17, 2024
1 parent bfc76ed commit 0207c1f
Showing 1 changed file with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ class IDEInstInteractionAnalysisTest : public ::testing::Test {

IDESolver IIASolver(IIAProblem, &HA->getICFG());
IIASolver.solve();
if (PrintDump) {
// IRDB->emitPreprocessedIR(llvm::outs());
IIASolver.dumpResults();
llvm::outs()
<< "\n======================================================\n";
printDump(HA->getProjectIRDB(), IIASolver.getSolverResults());
}
// if (PrintDump) {
// // IRDB->emitPreprocessedIR(llvm::outs());
// IIASolver.dumpResults();
// llvm::errs()
// << "\n======================================================\n";
// printDump(HA->getProjectIRDB(), IIASolver.getSolverResults());
// }
// do the comparison
for (const auto &[FunName, SrcLine, VarName, LatticeVal] : GroundTruth) {
const auto *Fun = IRDB->getFunctionDefinition(FunName);
Expand All @@ -137,6 +137,13 @@ class IDEInstInteractionAnalysisTest : public ::testing::Test {
EXPECT_TRUE(FactFound) << "Variable '" << VarName << "' missing at '"
<< llvmIRToString(IRLine) << "'.";
}

if (HasFailure()) {
IIASolver.dumpResults();
llvm::errs()
<< "\n======================================================\n";
printDump(HA->getProjectIRDB(), IIASolver.getSolverResults());
}
}

void TearDown() override {}
Expand Down Expand Up @@ -189,11 +196,11 @@ class IDEInstInteractionAnalysisTest : public ::testing::Test {
for (const auto *Inst : IRDB.getAllInstructions()) {
if (CurrFun != Inst->getFunction()) {
CurrFun = Inst->getFunction();
llvm::outs() << "\n=================== '" << CurrFun->getName()
llvm::errs() << "\n=================== '" << CurrFun->getName()
<< "' ===================\n";
}
llvm::outs() << " N: " << llvmIRToString(Inst) << '\n';
llvm::outs() << " D: " << printSet(taintsForInst(Inst, SR)) << "\n\n";
llvm::errs() << " N: " << llvmIRToString(Inst) << '\n';
llvm::errs() << " D: " << printSet(taintsForInst(Inst, SR)) << "\n\n";
}
}

Expand Down

0 comments on commit 0207c1f

Please sign in to comment.