summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-06-15 16:13:22 (GMT)
committerGitHub <noreply@github.com>2023-06-15 16:13:22 (GMT)
commitfcdd0ab9dc93871fa600aface194b294947fad1b (patch)
tree305a955e98f15290a2953021f5565e45b29657be /test
parent9a8c5810ed37d353522cbb26014698881cd52ce4 (diff)
downloadhdf5-fcdd0ab9dc93871fa600aface194b294947fad1b.zip
hdf5-fcdd0ab9dc93871fa600aface194b294947fad1b.tar.gz
hdf5-fcdd0ab9dc93871fa600aface194b294947fad1b.tar.bz2
Revert long double checks (#3133)
* Revert "Remove long double conversion work-arounds (#3097)" This reverts commit 1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9. * Update comments to reflect newer systems
Diffstat (limited to 'test')
-rw-r--r--test/dt_arith.c115
1 files changed, 112 insertions, 3 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index ccf2ec9..a26945f 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -11,6 +11,9 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
+ *
* Purpose: Tests the data type interface (H5T)
*/
@@ -4842,7 +4845,20 @@ run_fp_tests(const char *name)
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE);
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", name, "long double",
+ "float");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+ }
+#endif
+
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE);
#endif
@@ -4852,8 +4868,20 @@ run_fp_tests(const char *name)
#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE);
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE);
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double",
+ "float or double");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+ }
+#endif
#endif
done:
@@ -4919,12 +4947,47 @@ run_int_fp_conv(const char *name)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_INT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_LDOUBLE);
#if H5_SIZEOF_LONG != H5_SIZEOF_INT
+#if !defined(H5_LONG_TO_LDOUBLE_SPECIAL) && !defined(H5_DISABLE_SOME_LDOUBLE_CONV)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE);
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "(unsigned) long",
+ "long double");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to the special algorithm of hardware conversion.");
+ }
+#endif
#endif /* H5_SIZEOF_LONG!=H5_SIZEOF_INT */
#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
+#if H5_LLONG_TO_LDOUBLE_CORRECT
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LLONG, H5T_NATIVE_LDOUBLE);
+#else /* H5_LLONG_TO_LDOUBLE_CORRECT */
+ {
+ char str[256]; /*hello string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long long", "long double");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to compiler error in handling conversion.");
+ }
+#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */
+#if H5_LLONG_TO_LDOUBLE_CORRECT
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULLONG, H5T_NATIVE_LDOUBLE);
+#else /* H5_LLONG_TO_LDOUBLE_CORRECT */
+ {
+ char str[256]; /*hello string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "unsigned long long",
+ "long double");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to compiler not handling conversion.");
+ }
+#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */
#endif
#endif
@@ -5000,31 +5063,77 @@ run_fp_int_conv(const char *name)
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT);
}
else {
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT);
+#else
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", name, "long double",
+ "signed and unsigned char, short, int, long");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+#endif
}
#if H5_SIZEOF_LONG != H5_SIZEOF_INT
+#ifndef H5_LDOUBLE_TO_LONG_SPECIAL
if (test_values != TEST_SPECIAL && test_values != TEST_NORMAL) {
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG);
}
else {
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG);
+#endif
+ }
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double",
+ "(unsigned) long");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to the special algorithm of hardware conversion.");
}
+#endif
#endif /*H5_SIZEOF_LONG!=H5_SIZEOF_INT */
#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
+#ifdef H5_LDOUBLE_TO_LLONG_ACCURATE
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG);
+#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double", "long long");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to hardware conversion error.");
+ }
+#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+#if defined(H5_LDOUBLE_TO_LLONG_ACCURATE)
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG);
-#endif /* H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG */
+#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+ {
+ char str[256]; /*string */
-#endif /* H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE */
- } /* end for */
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions", name, "long double",
+ "unsigned long long");
+ HDprintf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to hardware conversion error.");
+ }
+#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+#endif
+#endif
+ } /* end for */
return nerrors;
}