Skip to content

Commit

Permalink
In fuzz/simplify, output errors to cerr, not cout (#7583)
Browse files Browse the repository at this point in the history
* In fuzz/simplify, output errors to cerr, not cout

This makes it easier to capture error output in downstream test harnesses

* Also add some more helpful text
  • Loading branch information
steven-johnson authored May 18, 2023
1 parent 4282a5d commit 02768ef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/fuzz/simplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,17 @@ bool test_simplification(Expr a, Expr b, Type t, const map<string, Expr> &vars)
continue;
}
if (!equal(a_j_v, b_j_v)) {
std::cerr << "Simplified Expr is not equal() to Original Expr!\n";

for (map<string, Expr>::const_iterator i = vars.begin(); i != vars.end(); i++) {
std::cout << i->first << " = " << i->second << "\n";
std::cerr << "Var " << i->first << " = " << i->second << "\n";
}

std::cout << a << "\n";
std::cout << b << "\n";
std::cout << "In vector lane " << j << ":\n";
std::cout << a_j << " -> " << a_j_v << "\n";
std::cout << b_j << " -> " << b_j_v << "\n";
std::cerr << "Original Expr is: " << a << "\n";
std::cerr << "Simplified Expr is: " << b << "\n";
std::cerr << "In vector lane " << j << ", original -> simplified:\n";
std::cerr << " " << a_j << " -> " << a_j_v << "\n";
std::cerr << " " << b_j << " -> " << b_j_v << "\n";
return false;
}
}
Expand Down

0 comments on commit 02768ef

Please sign in to comment.