summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/dfp/operator-comma.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/c-c++-common/dfp/operator-comma.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/c-c++-common/dfp/operator-comma.c')
-rw-r--r--gcc/testsuite/c-c++-common/dfp/operator-comma.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/dfp/operator-comma.c b/gcc/testsuite/c-c++-common/dfp/operator-comma.c
new file mode 100644
index 000000000..be6bf6f8c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dfp/operator-comma.c
@@ -0,0 +1,47 @@
+/* { dg-options "-O0" } */
+
+/* C99 6.5.17: Comma operator.
+ Test with decimal float operands. */
+
+#include "dfp-dbg.h"
+
+volatile _Decimal32 d32a, d32b, d32c;
+volatile _Decimal64 d64a, d64b, d64c;
+volatile _Decimal128 d128a, d128b, d128c;
+
+void
+init ()
+{
+ d32b = 123.456e94df;
+ d64b = 12.3456789012345e383dd;
+ d128b = 12345.6789012345678901e4000dl;
+
+ d32c = 1.3df;
+ d64c = 1.2dd;
+ d128c = 1.1dl;
+}
+
+int
+main ()
+{
+ d32a = (d32b, d32c);
+ if (d32a != d32c)
+ FAILURE
+ d64a = (d64b, 7.89dd, d64c);
+ if (d64a != d64c)
+ FAILURE
+ d128a = (45678.987654dl, d128c, d128b);
+ if (d128a != d128b)
+ FAILURE
+ d128a = (d32b, d64b, d128b);
+ if (d128a != d128b)
+ FAILURE
+ d32a = (d32b, 12, d64c);
+ if (d32a != d64c)
+ FAILURE;
+ d64a = (d64b, d32b, 12);
+ if (d64a != 12.0dd)
+ FAILURE;
+
+ FINISH
+}