You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When llvm-cov show shows instantiation groups, it seems to print them in a non-deterministic order (presumably influenced by hash bucket order).
This is a hassle for Rust's -Cinstrument-coverage tests, since they have to jump through hoops to ignore instantiation names when comparing output snapshots.
Ideally the instantiations should at least be naïvely sorted by their function name. That would at least be deterministic in the common case where all instantiations have distinct names.
The text was updated successfully, but these errors were encountered:
// We need the expansions, instantiations, and branches sorted so we can go
// through them while we iterate lines.
llvm::stable_sort(ExpansionSubViews);
llvm::stable_sort(InstantiationSubViews);
llvm::stable_sort(BranchSubViews);
But this sort only compares their (last) line number so that they display after the correct line, and does not compare the function name for instantiations with the same line:
Here's an example of Rust's instrument-coverage tests accidentally being broken, due to a bug in the regex used to ignore instantiation names: rust-lang/rust#110942
Another potential explanation is that llvm-cov is faithfully preserving the order of entries in the binary’s __llvm_covfun section, and those entries are linked in an unpredictable order.
When
llvm-cov show
shows instantiation groups, it seems to print them in a non-deterministic order (presumably influenced by hash bucket order).This is a hassle for Rust's
-Cinstrument-coverage
tests, since they have to jump through hoops to ignore instantiation names when comparing output snapshots.Ideally the instantiations should at least be naïvely sorted by their function name. That would at least be deterministic in the common case where all instantiations have distinct names.
The text was updated successfully, but these errors were encountered: