On Mon, 4 Nov 2024 at 10:55, Jakub Jelinek <ja...@redhat.com> wrote: > > Hi! > > Christophe mentioned in bugzilla that the test FAILs on aarch64, > I'm not including <climits> and use INT_MAX. > Apparently during my testing I got it because the test preinclude > -include bits/stdc++.h > and that includes <climits>, dunno why that didn't happen on aarch64. > In any case, either I can add #include <climits>, or because the > test already has #include <limits> I've changed uses of INT_MAX > with std::numeric_limits<int>::max(), that should be the same thing. > But if you prefer > #include <climits> > I can surely add that instead.
Using std::numeric_limits is fine here. > Tested on x86_64-linux, ok for trunk? OK, thanks. > > 2024-11-04 Jakub Jelinek <ja...@redhat.com> > > PR libstdc++/117406 > * testsuite/26_numerics/headers/cmath/117406.cc: Use > std::numeric_limits<int>::max() instead of INT_MAX. > > --- libstdc++-v3/testsuite/26_numerics/headers/cmath/117406.cc.jj > 2024-11-02 18:48:47.466350158 +0100 > +++ libstdc++-v3/testsuite/26_numerics/headers/cmath/117406.cc 2024-11-04 > 11:40:25.793831812 +0100 > @@ -31,9 +31,9 @@ test () > int t0 = std::ilogb(T(4.0)); > VERIFY( t0 == 2 ); > int t1 = std::ilogb(lim::infinity()); > - VERIFY( t1 == INT_MAX ); > + VERIFY( t1 == std::numeric_limits<int>::max() ); > int t2 = std::ilogb(-lim::infinity()); > - VERIFY( t2 == INT_MAX ); > + VERIFY( t2 == std::numeric_limits<int>::max() ); > } > > int > > Jakub >