This patch is highly based on the ppc64le-long-double test that was available in the previous commit. However, it adds an extra step that ignores mock if the test is run inside an unprivileged container solution. The first test (exp) evaluates if clang is able to build C programs for both IBM double-double as well as IEEE 128-bit long double. As Fedora uses glibc by default, which supports both scenarios, both executables should work. The second test (parse) uses clang in order to evaluate if C++ programs built with default parameters and linking against libc++ use IEEE 128-bit long double. This test should be extended in the future in order to evaluate that clang is able to generate C++ programs for both IBM double-double and IEEE 128-bit long double using libstdc++. This can't be enabled now because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81122 .
15 lines
401 B
C++
15 lines
401 B
C++
/* Check how the C++ standard library parses the following number correctly.
|
|
On IBM double-double, the 7 least significant bits are messed up.
|
|
On IEEE 128-bit long double, this number is correctly represented. */
|
|
#include <sstream>
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
long double d;
|
|
std::stringstream ss("0x1.5bf0a8b1457695355fb8ac404e7ap+1");
|
|
|
|
ss >> d;
|
|
printf("%La\n", d);
|
|
|
|
return 0;
|
|
}
|