summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/c-c++-common/dfp/func-scalar.c
diff options
context:
space:
mode:
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-18 17:40:28 +0000
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-18 17:40:28 +0000
commitb784f978f781a74c42432a6a6d637006593c6bf4 (patch)
tree491a1bf6a41bd7d30c6f88190188d8e5b512b907 /gcc/testsuite/c-c++-common/dfp/func-scalar.c
parentfdf67fd16b391bce4171e10d4c081cac9d8e5706 (diff)
downloadppe42-gcc-b784f978f781a74c42432a6a6d637006593c6bf4.tar.gz
ppe42-gcc-b784f978f781a74c42432a6a6d637006593c6bf4.zip
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151861 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/c-c++-common/dfp/func-scalar.c')
-rw-r--r--gcc/testsuite/c-c++-common/dfp/func-scalar.c192
1 files changed, 192 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dfp/func-scalar.c b/gcc/testsuite/c-c++-common/dfp/func-scalar.c
new file mode 100644
index 00000000000..370c21b20e2
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dfp/func-scalar.c
@@ -0,0 +1,192 @@
+/* C99 6.5.2.2 Function calls.
+ Test scalar passing and return values involving decimal floating
+ point types. */
+
+#include "dfp-dbg.h"
+
+/* A handful of functions that return their Nth _Decimal32
+ argument. */
+
+_Decimal32
+arg0_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg0;
+}
+
+_Decimal32
+arg1_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg1;
+}
+
+_Decimal32
+arg2_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg2;
+}
+
+_Decimal32
+arg3_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg3;
+}
+
+_Decimal32
+arg4_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg4;
+}
+
+_Decimal32
+arg5_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
+ _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
+{
+ return arg5;
+}
+
+
+/* A handful of functions that return their Nth _Decimal64
+ argument. */
+
+_Decimal64
+arg0_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg0;
+}
+
+_Decimal64
+arg1_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg1;
+}
+
+_Decimal64
+arg2_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg2;
+}
+
+_Decimal64
+arg3_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg3;
+}
+
+_Decimal64
+arg4_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg4;
+}
+
+_Decimal64
+arg5_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
+ _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
+{
+ return arg5;
+}
+
+
+/* A handful of functions that return their Nth _Decimal128
+ argument. */
+
+_Decimal128
+arg0_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg0;
+}
+
+_Decimal128
+arg1_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg1;
+}
+
+_Decimal128
+arg2_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg2;
+}
+
+_Decimal128
+arg3_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg3;
+}
+
+_Decimal128
+arg4_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg4;
+}
+
+_Decimal128
+arg5_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
+ _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
+{
+ return arg5;
+}
+
+
+
+int
+main ()
+{
+ /* _Decimal32 variants. */
+ if (arg0_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 0.0df)
+ FAILURE
+ if (arg1_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 1.0df)
+ FAILURE
+ if (arg2_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 2.0df)
+ FAILURE
+ if (arg3_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 3.0df)
+ FAILURE
+ if (arg4_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 4.0df)
+ FAILURE
+ if (arg5_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 5.0df)
+ FAILURE
+
+ /* _Decimal64 variants. */
+ if (arg0_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 0.0dd)
+ FAILURE
+ if (arg1_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 1.0dd)
+ FAILURE
+ if (arg2_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 2.0dd)
+ FAILURE
+ if (arg3_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 3.0dd)
+ FAILURE
+ if (arg4_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 4.0dd)
+ FAILURE
+ if (arg5_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 5.0dd)
+ FAILURE
+
+ /* _Decimal128 variants. */
+ if (arg0_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 0.0dl)
+ FAILURE
+ if (arg1_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 1.0dl)
+ FAILURE
+ if (arg2_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 2.0dl)
+ FAILURE
+ if (arg3_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 3.0dl)
+ FAILURE
+ if (arg4_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 4.0dl)
+ FAILURE
+ if (arg5_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 5.0dl)
+ FAILURE
+
+ FINISH
+}
OpenPOWER on IntegriCloud