This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[testsuite] (commited) move many dfp tests to c-c++-common
- From: Janis Johnson <janis187 at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Sep 2009 10:43:16 -0700
- Subject: [testsuite] (commited) move many dfp tests to c-c++-common
- Reply-to: janis187 at us dot ibm dot com
This patch moves dfp tests that are appropriate for use in C++ testing
from gcc.dg/dfp to a new directory, c-c++-common/dfp. The tests are
currently only run for C; there are a couple more changes necessary
before they can also be run for C++.
Tested on powerpc64-linux, and on i686-linux with builds configured
with --enable-decimal-float=bid/dpd/no. Checked in on trunk.
2009-09-18 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/dfp/dfp.exp: Also run tests in c-c++-common/dfp.
* c-c++-common/dfp: New directory.
* c-c++-common/dfp/dfp-dbg.h: New file.
* gcc.dg/dfp/call-by-value.c: Move to ...
* c-c++-common/call-by-value.c: here.
* gcc.dg/dfp/cast.c: Move to ...
* c-c++-common/cast.c: here.
* gcc.dg/dfp/compare-eq-const.c: Move to ...
* c-c++-common/compare-eq-const.c: here.
* gcc.dg/dfp/compare-eq-d128.c: Move to ...
* c-c++-common/compare-eq-d128.c: here.
* gcc.dg/dfp/compare-eq-d32.c: Move to ...
* c-c++-common/compare-eq-d32.c: here.
* gcc.dg/dfp/compare-eq-d64.c: Move to ...
* c-c++-common/compare-eq-d64.c: here.
* gcc.dg/dfp/compare-eq-dfp.c: Move to ...
* c-c++-common/compare-eq-dfp.c: here.
* gcc.dg/dfp/compare-eq.h: Move to ...
* c-c++-common/compare-eq.h: here.
* gcc.dg/dfp/compare-rel-const.c: Move to ...
* c-c++-common/compare-rel-const.c: here.
* gcc.dg/dfp/compare-rel-d128.c: Move to ...
* c-c++-common/compare-rel-d128.c: here.
* gcc.dg/dfp/compare-rel-d32.c: Move to ...
* c-c++-common/compare-rel-d32.c: here.
* gcc.dg/dfp/compare-rel-d64.c: Move to ...
* c-c++-common/compare-rel-d64.c: here.
* gcc.dg/dfp/compare-rel-dfp.c: Move to ...
* c-c++-common/compare-rel-dfp.c: here.
* gcc.dg/dfp/compare-rel.h: Move to ...
* c-c++-common/compare-rel.h: here.
* gcc.dg/dfp/compare-special-d128.c: Move to ...
* c-c++-common/compare-special-d128.c: here.
* gcc.dg/dfp/compare-special-d32.c: Move to ...
* c-c++-common/compare-special-d32.c: here.
* gcc.dg/dfp/compare-special-d64.c: Move to ...
* c-c++-common/compare-special-d64.c: here.
* gcc.dg/dfp/compare-special.h: Move to ...
* c-c++-common/compare-special.h: here.
* gcc.dg/dfp/constants-zero.c: Move to ...
* c-c++-common/constants-zero.c: here.
* gcc.dg/dfp/convert-bfp-10.c: Move to ...
* c-c++-common/convert-bfp-10.c: here.
* gcc.dg/dfp/convert-bfp-11.c: Move to ...
* c-c++-common/convert-bfp-11.c: here.
* gcc.dg/dfp/convert-bfp-12.c: Move to ...
* c-c++-common/convert-bfp-12.c: here.
* gcc.dg/dfp/convert-bfp-13.c: Move to ...
* c-c++-common/convert-bfp-13.c: here.
* gcc.dg/dfp/convert-bfp-14.c: Move to ...
* c-c++-common/convert-bfp-14.c: here.
* gcc.dg/dfp/convert-bfp-2.c: Move to ...
* c-c++-common/convert-bfp-2.c: here.
* gcc.dg/dfp/convert-bfp-3.c: Move to ...
* c-c++-common/convert-bfp-3.c: here.
* gcc.dg/dfp/convert-bfp-4.c: Move to ...
* c-c++-common/convert-bfp-4.c: here.
* gcc.dg/dfp/convert-bfp-5.c: Move to ...
* c-c++-common/convert-bfp-5.c: here.
* gcc.dg/dfp/convert-bfp-6.c: Move to ...
* c-c++-common/convert-bfp-6.c: here.
* gcc.dg/dfp/convert-bfp-7.c: Move to ...
* c-c++-common/convert-bfp-7.c: here.
* gcc.dg/dfp/convert-bfp-8.c: Move to ...
* c-c++-common/convert-bfp-8.c: here.
* gcc.dg/dfp/convert-bfp-9.c: Move to ...
* c-c++-common/convert-bfp-9.c: here.
* gcc.dg/dfp/convert-bfp.c: Move to ...
* c-c++-common/convert-bfp.c: here.
* gcc.dg/dfp/convert-bfp-fold.c: Move to ...
* c-c++-common/convert-bfp-fold.c: here.
* gcc.dg/dfp/convert-dfp.c: Move to ...
* c-c++-common/convert-dfp.c: here.
* gcc.dg/dfp/convert-dfp-fold-2.c: Move to ...
* c-c++-common/convert-dfp-fold-2.c: here.
* gcc.dg/dfp/convert-dfp-fold.c: Move to ...
* c-c++-common/convert-dfp-fold.c: here.
* gcc.dg/dfp/convert.h: Move to ...
* c-c++-common/convert.h: here.
* gcc.dg/dfp/convert-int.c: Move to ...
* c-c++-common/convert-int.c: here.
* gcc.dg/dfp/convert-int-fold.c: Move to ...
* c-c++-common/convert-int-fold.c: here.
* gcc.dg/dfp/convert-int-max.c: Move to ...
* c-c++-common/convert-int-max.c: here.
* gcc.dg/dfp/convert-int-max-fold.c: Move to ...
* c-c++-common/convert-int-max-fold.c: here.
* gcc.dg/dfp/convert-int-saturate.c: Move to ...
* c-c++-common/convert-int-saturate.c: here.
* gcc.dg/dfp/func-array.c: Move to ...
* c-c++-common/func-array.c: here.
* gcc.dg/dfp/func-deref.c: Move to ...
* c-c++-common/func-deref.c: here.
* gcc.dg/dfp/func-mixed.c: Move to ...
* c-c++-common/func-mixed.c: here.
* gcc.dg/dfp/func-pointer.c: Move to ...
* c-c++-common/func-pointer.c: here.
* gcc.dg/dfp/func-scalar.c: Move to ...
* c-c++-common/func-scalar.c: here.
* gcc.dg/dfp/func-struct.c: Move to ...
* c-c++-common/func-struct.c: here.
* gcc.dg/dfp/func-vararg-alternate-d128-2.c: Move to ...
* c-c++-common/func-vararg-alternate-d128-2.c: here.
* gcc.dg/dfp/func-vararg-alternate-d128.c: Move to ...
* c-c++-common/func-vararg-alternate-d128.c: here.
* gcc.dg/dfp/func-vararg-alternate-d32.c: Move to ...
* c-c++-common/func-vararg-alternate-d32.c: here.
* gcc.dg/dfp/func-vararg-alternate-d64.c: Move to ...
* c-c++-common/func-vararg-alternate-d64.c: here.
* gcc.dg/dfp/func-vararg-alternate.h: Move to ...
* c-c++-common/func-vararg-alternate.h: here.
* gcc.dg/dfp/func-vararg-dfp.c: Move to ...
* c-c++-common/func-vararg-dfp.c: here.
* gcc.dg/dfp/func-vararg-mixed-2.c: Move to ...
* c-c++-common/func-vararg-mixed-2.c: here.
* gcc.dg/dfp/func-vararg-mixed.c: Move to ...
* c-c++-common/func-vararg-mixed.c: here.
* gcc.dg/dfp/func-vararg-size0.c: Move to ...
* c-c++-common/func-vararg-size0.c: here.
* gcc.dg/dfp/inf-1.c: Move to ...
* c-c++-common/inf-1.c: here.
* gcc.dg/dfp/loop-index.c: Move to ...
* c-c++-common/loop-index.c: here.
* gcc.dg/dfp/modes.c: Move to ...
* c-c++-common/modes.c: here.
* gcc.dg/dfp/nan-1.c: Move to ...
* c-c++-common/nan-1.c: here.
* gcc.dg/dfp/nan-2.c: Move to ...
* c-c++-common/nan-2.c: here.
* gcc.dg/dfp/operator-arith-fold.c: Move to ...
* c-c++-common/operator-arith-fold.c: here.
* gcc.dg/dfp/operator-assignment.c: Move to ...
* c-c++-common/operator-assignment.c: here.
* gcc.dg/dfp/operator-comma.c: Move to ...
* c-c++-common/operator-comma.c: here.
* gcc.dg/dfp/operator-cond.c: Move to ...
* c-c++-common/operator-cond.c: here.
* gcc.dg/dfp/operator-logical.c: Move to ...
* c-c++-common/operator-logical.c: here.
* gcc.dg/dfp/operator-unary.c: Move to ...
* c-c++-common/operator-unary.c: here.
* gcc.dg/dfp/pr31385.c: Move to ...
* c-c++-common/pr31385.c: here.
* gcc.dg/dfp/pr33466.c: Move to ...
* c-c++-common/pr33466.c: here.
* gcc.dg/dfp/pr35620.c: Move to ...
* c-c++-common/pr35620.c: here.
* gcc.dg/dfp/pr36800.c: Move to ...
* c-c++-common/pr36800.c: here.
* gcc.dg/dfp/pr39034.c: Move to ...
* c-c++-common/pr39034.c: here.
* gcc.dg/dfp/pr39035.c: Move to ...
* c-c++-common/pr39035.c: here.
* gcc.dg/dfp/pr39902.c: Move to ...
* c-c++-common/pr39902.c: here.
* gcc.dg/dfp/pr39986.c: Move to ...
* c-c++-common/pr39986.c: here.
* gcc.dg/dfp/signbit-1.c: Move to ...
* c-c++-common/signbit-1.c: here.
* gcc.dg/dfp/signbit-2.c: Move to ...
* c-c++-common/signbit-2.c: here.
* gcc.dg/dfp/struct-layout-1.c: Move to ...
* c-c++-common/struct-layout-1.c: here.
* gcc.dg/dfp/usual-arith-conv.c: Move to ...
* c-c++-common/usual-arith-conv.c: here.
* gcc.dg/dfp/usual-arith-conv-const.c: Move to ...
* c-c++-common/usual-arith-conv-const.c: here.
Index: gcc/testsuite/gcc.dg/dfp/dfp.exp
===================================================================
--- gcc/testsuite/gcc.dg/dfp/dfp.exp (revision 151821)
+++ gcc/testsuite/gcc.dg/dfp/dfp.exp (working copy)
@@ -48,9 +48,12 @@ set DEFAULT_CFLAGS "-std=gnu99"
# Initialize `dg'.
dg-init
-# Main loop.
+# Main loop; run the C-only tests.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
+# Run the tests that are shared with C++ testing.
+dg-runtest [lsort [glob -nocomplain $srcdir/c-c++-common/dfp/*c]] \
+ "" $DEFAULT_CFLAGS
# All done.
dg-finish
Index: gcc/testsuite/c-c++-common/dfp/dfp-dbg.h
===================================================================
--- gcc/testsuite/c-c++-common/dfp/dfp-dbg.h (revision 0)
+++ gcc/testsuite/c-c++-common/dfp/dfp-dbg.h (revision 0)
@@ -0,0 +1,20 @@
+#ifdef __cplusplus
+typedef float _Decimal32 __attribute__((mode(SD)));
+typedef float _Decimal64 __attribute__((mode(DD)));
+typedef float _Decimal128 __attribute__((mode(TD)));
+
+#define EXTERN extern "C"
+#else
+#define EXTERN extern
+#endif
+
+int failures;
+
+#ifdef DBG
+extern int printf (const char *, ...);
+#define FAILURE { printf ("failed at line %d\n", __LINE__); failures++; }
+#define FINISH if (failures != 0) __builtin_abort (); return 0;
+#else
+#define FAILURE __builtin_abort ();
+#define FINISH return 0;
+#endif