Fix float conversion for PPC.
authorSamuel Benzaquen <sbenza@google.com>
Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)
committerBenjamin Barenblat <bbaren@debian.org>
Tue, 9 Feb 2021 19:41:06 +0000 (19:41 +0000)
commit4fd12ac19edb2f8be50739174a5407e36924f080
tree8c3e2d47c6b9aedc6e229823483b4a1e16903c8b
parent9059fdd51224493244d7d70cd1bb31612a729e27
Fix float conversion for PPC.

Origin: backport, https://github.com/abseil/abseil-cpp/commit/c36d825d9a5443f81d2656685ae021d6326da90c

In PPC `long double` is a double-double representation which behaves weirdly
wrt numeric_limits. Don't take `long double` into account when we are not
handling `long double` natively anyway.

Fix the convert test to always run the conversion even if we are not going to
compare against libc's printf result. This allows exercising the code itself to
make sure we don't trigger assertions or UB found by sanitizers.

The author works at Google. Upstream applied this patch as Piper revision
355857729 and exported it to GitHub; the Applied-Upstream URL above points to
the exported commit.

Gbp-Pq: Name ppc-float-conversion.diff
absl/strings/internal/str_format/convert_test.cc
absl/strings/internal/str_format/float_conversion.cc