This is not mandated by the standard, so it goes in libcxx/test/libcxx/.
It's certainly arguable that the algorithms changed here (is_heap, is_sorted, min, max) are harmless and we should just let them copy their comparators once. But at the same time, it's nice to have all our algorithms be 100% consistent and never copy a comparator, not even once.
P.S. — If I find the time, I'll investigate the thing I was talking about way back in D93562, where we change _Comp_ref to be a lightweight value type instead of a reference type, and then we never need to pass the explicit argument <_Comp_ref> to anything. That would be a vastly more invasive PR, touching all the algorithms; this new test would be the regression-test that we would expect to continue passing even after that invasive change.
This was missing _LIBCPP_HIDE_FROM_ABI; I've added it.