summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-09-14 15:50:30 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-09-14 15:50:30 (GMT)
commit90315af428610adae95d0928498f2861766f6ed4 (patch)
tree05232cbec1cd01dadf70eaabcfd94d91a2c8ecdc /test
parentbae05c1ad5a067498389eb64ca990e0e435de1da (diff)
downloadhdf5-90315af428610adae95d0928498f2861766f6ed4.zip
hdf5-90315af428610adae95d0928498f2861766f6ed4.tar.gz
hdf5-90315af428610adae95d0928498f2861766f6ed4.tar.bz2
[svn-r27770] Bring r27428 from trunk
Reverts the following changes: 27737, 27742, 27743 These involve double conversions that cause problems with the IBM XL compiler. Tested on: h5committest ostrich w/ XL C compiler
Diffstat (limited to 'test')
-rw-r--r--test/dt_arith.c90
1 files changed, 74 insertions, 16 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c
index 8e8ffba..4337690 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -4930,8 +4930,32 @@ run_int_fp_conv(const char *name)
#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");
+ printf("%-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");
+ printf("%-70s", str);
+ SKIPPED();
+ HDputs(" Test skipped due to compiler not handling conversion.");
+ }
+#endif /* H5_LLONG_TO_LDOUBLE_CORRECT */
#endif
#endif
@@ -4979,15 +5003,15 @@ run_fp_int_conv(const char *name)
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UINT);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UINT);
-#if H5_SIZEOF_LONG!=H5_SIZEOF_INT
+#if H5_SIZEOF_LONG != H5_SIZEOF_INT
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULONG);
-#endif
+#endif /* H5_SIZEOF_LONG != H5_SIZEOF_INT */
-#if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG
+#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG
if(!strcmp(name, "hw")) { /* Hardware conversion */
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG);
@@ -4997,20 +5021,20 @@ run_fp_int_conv(const char *name)
}
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULLONG);
nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULLONG);
-#endif
+#endif /* H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG */
-#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE
+#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE
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);
-#if H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0
+#if H5_SIZEOF_LONG != H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE != 0
#ifndef H5_LDOUBLE_TO_LONG_SPECIAL
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
+#else /* H5_LDOUBLE_TO_LONG_SPECIAL */
{
char str[256]; /*string */
@@ -5018,24 +5042,58 @@ run_fp_int_conv(const char *name)
name, "long double", "(unsigned) long");
printf("%-70s", str);
SKIPPED();
-#if H5_SIZEOF_LONG_DOUBLE!=0
+#if H5_SIZEOF_LONG_DOUBLE != 0
HDputs(" Test skipped due to the special algorithm of hardware conversion.");
-#else
+#else /* H5_SIZEOF_LONG_DOUBLE */
HDputs(" Test skipped due to disabled long double.");
-#endif
+#endif /* H5_SIZEOF_LONG_DOUBLE */
}
-#endif
-#endif /*H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0 */
+#endif /* H5_LDOUBLE_TO_LONG_SPECIAL */
-#if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG && H5_SIZEOF_LONG_DOUBLE!=0
+#endif /*H5_SIZEOF_LONG != H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE != 0 */
+
+#if H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG && H5_SIZEOF_LONG_DOUBLE != 0
+#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");
+ printf("%-70s", str);
+ SKIPPED();
+#if H5_SIZEOF_LONG_DOUBLE != 0
+ HDputs(" Test skipped due to hardware conversion error.");
+#else /* H5_SIZEOF_LONG_DOUBLE != 0 */
+ HDputs(" Test skipped due to disabled long double.");
+#endif /* H5_SIZEOF_LONG_DOUBLE != 0 */
+ }
+#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
-#endif
+#else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s %s -> %s conversions",
+ name, "long double", "unsigned long long");
+ printf("%-70s", str);
+ SKIPPED();
+#if H5_SIZEOF_LONG_DOUBLE != 0
+ HDputs(" Test skipped due to hardware conversion error.");
+#else /* H5_SIZEOF_LONG_DOUBLE != 0 */
+ HDputs(" Test skipped due to disabled long double.");
+#endif /* H5_SIZEOF_LONG_DOUBLE !=0 */
+ }
+#endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/
+
+#endif /* H5_SIZEOF_LONG_LONG != H5_SIZEOF_LONG && H5_SIZEOF_LONG_DOUBLE != 0 */
+#endif /* H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE */
} /* end for */
return nerrors;
-}
+} /* end run_fp_int_conv() */
/*-------------------------------------------------------------------------