aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libstdc++-v3/testsuite/decimal
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/libstdc++-v3/testsuite/decimal
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/libstdc++-v3/testsuite/decimal')
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/binary-arith.cc384
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/cast_neg.cc61
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/comparison.cc564
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc262
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment.cc260
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-float.cc104
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc199
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc108
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc87
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/ctor.cc68
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc184
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/incdec.cc182
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/make-decimal.cc135
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-arith_neg.cc138
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-cmp_neg.cc104
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/operator_neg.cc159
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-1.cc71
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-2.cc71
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-3.cc71
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/pr58815.cc35
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/decimal/unary-arith.cc99
21 files changed, 3346 insertions, 0 deletions
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/binary-arith.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/binary-arith.cc
new file mode 100644
index 000000000..60524f38d
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/binary-arith.cc
@@ -0,0 +1,384 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.8 Binary arithmetic operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -20;
+unsigned int ui = 50;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+binary_add_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = si + a; VERIFY (b == 980);
+ b = ui + a; VERIFY (b == 1050);
+ b = sl + a; VERIFY (b == 990);
+ b = ul + a; VERIFY (b == 1020);
+ b = sll + a; VERIFY (b == 975);
+ b = ull + a; VERIFY (b == 1050);
+ b = d32 + a; VERIFY (b == 1005);
+ b = (decimal32)(d64 + a); VERIFY (b == 990);
+ b = (decimal32)(d128 + a); VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = (decimal32)(a + d64); VERIFY (b == 990);
+ b = (decimal32)(a + d128); VERIFY (b == 1025);
+}
+
+void
+binary_subtract_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = (decimal32)(a - d64); VERIFY (b == 1010);
+ b = (decimal32)(a - d128); VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = (decimal32)(d64 - a); VERIFY (b == 990);
+ b = (decimal32)(d128 - a); VERIFY (b == 1025);
+}
+
+void
+binary_multiply_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = (decimal32)(a * d64); VERIFY (b == -10000);
+ b = (decimal32)(a * d128); VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = (decimal32)(d64 * a); VERIFY (b == -10000);
+ b = (decimal32)(d128 * a); VERIFY (b == 25000);
+}
+
+void
+binary_divide_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = (decimal32)(a / d64); VERIFY (b == -100);
+ b = (decimal32)(a / d128); VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = (decimal32)(d64 / a); VERIFY (b == -2);
+ b = (decimal32)(d128 / a); VERIFY (b == 5);
+}
+
+void
+binary_add_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = (decimal64)(a + d128); VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = (decimal64)(a + d128); VERIFY (b == 1025);
+}
+
+void
+binary_subtract_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = a - d64; VERIFY (b == 1010);
+ b = (decimal64)(a - d128); VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = d64 - a; VERIFY (b == 990);
+ b = (decimal64)(d128 - a); VERIFY (b == 1025);
+}
+
+void
+binary_multiply_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = a * d64; VERIFY (b == -10000);
+ b = (decimal64)(a * d128); VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = d64 * a; VERIFY (b == -10000);
+ b = (decimal64)(d128 * a); VERIFY (b == 25000);
+}
+
+void
+binary_divide_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = a / d64; VERIFY (b == -100);
+ b = (decimal64)(a / d128); VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = d64 / a; VERIFY (b == -2);
+ b = (decimal64)(d128 / a); VERIFY (b == 5);
+}
+
+void
+binary_add_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = a + d128; VERIFY (b == 1025);
+
+ b = a + si; VERIFY (b == 980);
+ b = a + ui; VERIFY (b == 1050);
+ b = a + sl; VERIFY (b == 990);
+ b = a + ul; VERIFY (b == 1020);
+ b = a + sll; VERIFY (b == 975);
+ b = a + ull; VERIFY (b == 1050);
+ b = a + d32; VERIFY (b == 1005);
+ b = a + d64; VERIFY (b == 990);
+ b = a + d128; VERIFY (b == 1025);
+}
+
+void
+binary_subtract_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a - si; VERIFY (b == 1020);
+ b = a - ui; VERIFY (b == 950);
+ b = a - sl; VERIFY (b == 1010);
+ b = a - ul; VERIFY (b == 980);
+ b = a - sll; VERIFY (b == 1025);
+ b = a - ull; VERIFY (b == 950);
+ b = a - d32; VERIFY (b == 995);
+ b = a - d64; VERIFY (b == 1010);
+ b = a - d128; VERIFY (b == 975);
+
+ a = -1000;
+ b = si - a; VERIFY (b == 980);
+ b = ui - a; VERIFY (b == 1050);
+ b = sl - a; VERIFY (b == 990);
+ b = ul - a; VERIFY (b == 1020);
+ b = sll - a; VERIFY (b == 975);
+ b = ull - a; VERIFY (b == 1050);
+ b = d32 - a; VERIFY (b == 1005);
+ b = d64 - a; VERIFY (b == 990);
+ b = d128 - a; VERIFY (b == 1025);
+}
+
+void
+binary_multiply_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a * si; VERIFY (b == -20000);
+ b = a * ui; VERIFY (b == 50000);
+ b = a * sl; VERIFY (b == -10000);
+ b = a * ul; VERIFY (b == 20000);
+ b = a * sll; VERIFY (b == -25000);
+ b = a * ull; VERIFY (b == 50000);
+ b = a * d32; VERIFY (b == 5000);
+ b = a * d64; VERIFY (b == -10000);
+ b = a * d128; VERIFY (b == 25000);
+
+ b = si * a; VERIFY (b == -20000);
+ b = ui * a; VERIFY (b == 50000);
+ b = sl * a; VERIFY (b == -10000);
+ b = ul * a; VERIFY (b == 20000);
+ b = sll * a; VERIFY (b == -25000);
+ b = ull * a; VERIFY (b == 50000);
+ b = d32 * a; VERIFY (b == 5000);
+ b = d64 * a; VERIFY (b == -10000);
+ b = d128 * a; VERIFY (b == 25000);
+}
+
+void
+binary_divide_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a / si; VERIFY (b == -50);
+ b = a / ui; VERIFY (b == 20);
+ b = a / sl; VERIFY (b == -100);
+ b = a / ul; VERIFY (b == 50);
+ b = a / sll; VERIFY (b == -40);
+ b = a / ull; VERIFY (b == 20);
+ b = a / d32; VERIFY (b == 200);
+ b = a / d64; VERIFY (b == -100);
+ b = a / d128; VERIFY (b == 40);
+
+ a = 5;
+ b = si / a; VERIFY (b == -4);
+ b = ui / a; VERIFY (b == 10);
+ b = sl / a; VERIFY (b == -2);
+ b = ul / a; VERIFY (b == 4);
+ b = sll / a; VERIFY (b == -5);
+ b = ull / a; VERIFY (b == 10);
+ b = d32 / a; VERIFY (b == 1);
+ b = d64 / a; VERIFY (b == -2);
+ b = d128 / a; VERIFY (b == 5);
+}
+
+int
+main ()
+{
+ binary_add_32 ();
+ binary_subtract_32 ();
+ binary_multiply_32 ();
+ binary_divide_32 ();
+
+ binary_add_64 ();
+ binary_subtract_64 ();
+ binary_multiply_64 ();
+ binary_divide_64 ();
+
+ binary_add_128 ();
+ binary_subtract_128 ();
+ binary_multiply_128 ();
+ binary_divide_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/cast_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/cast_neg.cc
new file mode 100644
index 000000000..b32c91316
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/cast_neg.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 doesn't say explicitly that the conversion from a
+// decimal floating-point type to a generic float type is prohibited but
+// it implies that in section 4.3 when it says "In C, objects of decimal
+// floating-oint type can be converted to generic floating-point type by
+// means of an explicit cast. In C++ this is not possible." Check that
+// attempt to do a cast are flagged as errors.
+
+#include <decimal/decimal>
+
+using namespace std::decimal;
+
+float f;
+double d;
+long double ld;
+decimal32 d32;
+decimal64 d64;
+decimal128 d128;
+
+void
+foo (void)
+{
+ f = d32; // { dg-error "error" }
+ f = d64; // { dg-error "error" }
+ f = d128; // { dg-error "error" }
+ d = d32; // { dg-error "error" }
+ d = d64; // { dg-error "error" }
+ d = d128; // { dg-error "error" }
+ ld = d32; // { dg-error "error" }
+ ld = d64; // { dg-error "error" }
+ ld = d128; // { dg-error "error" }
+
+ f = (float)d32; // { dg-error "error" }
+ f = (float)d64; // { dg-error "error" }
+ f = (float)d128; // { dg-error "error" }
+ d = (double)d32; // { dg-error "error" }
+ d = (double)d64; // { dg-error "error" }
+ d = (double)d128; // { dg-error "error" }
+ ld = (long double)d32; // { dg-error "error" }
+ ld = (long double)d64; // { dg-error "error" }
+ ld = (long double)d128; // { dg-error "error" }
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/comparison.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/comparison.cc
new file mode 100644
index 000000000..cf7e6dd11
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/comparison.cc
@@ -0,0 +1,564 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.9 Comparison operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -20;
+unsigned int ui = 50;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compare_eq_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = (decimal32)d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = (decimal32)d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+void
+compare_eq_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = (decimal64)d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+void
+compare_eq_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+
+ a = si; VERIFY (a == si); VERIFY (si == a);
+ a = ui; VERIFY (a == ui); VERIFY (ui == a);
+ a = sl; VERIFY (a == sl); VERIFY (sl == a);
+ a = ul; VERIFY (a == ul); VERIFY (ul == a);
+ a = sll; VERIFY (a == sll); VERIFY (sll == a);
+ a = ull; VERIFY (a == ull); VERIFY (ull == a);
+ a = d32; VERIFY (a == d32); VERIFY (d32 == a);
+ a = d64; VERIFY (a == d64); VERIFY (d64 == a);
+ a = d128; VERIFY (a == d128); VERIFY (d128 == a);
+}
+
+void
+compare_ne_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a = 100;
+
+ VERIFY (a != si); VERIFY (si != a);
+ VERIFY (a != ui); VERIFY (ui != a);
+ VERIFY (a != sl); VERIFY (sl != a);
+ VERIFY (a != ul); VERIFY (ul != a);
+ VERIFY (a != sll); VERIFY (sll != a);
+ VERIFY (a != ull); VERIFY (ull != a);
+ VERIFY (a != d32); VERIFY (d32 != a);
+ VERIFY (a != d64); VERIFY (d64 != a);
+ VERIFY (a != d128); VERIFY (d128 != a);
+}
+
+void
+compare_lt_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a = -100;
+
+ VERIFY (a < si);
+ VERIFY (a < ui);
+ VERIFY (a < sl);
+ VERIFY (a < ul);
+ VERIFY (a < sll);
+ VERIFY (a < ull);
+ VERIFY (a < d32);
+ VERIFY (a < d64);
+ VERIFY (a < d128);
+
+ a = 100;
+ VERIFY (si < a);
+ VERIFY (ui < a);
+ VERIFY (sl < a);
+ VERIFY (ul < a);
+ VERIFY (sll < a);
+ VERIFY (ull < a);
+ VERIFY (d32 < a);
+ VERIFY (d64 < a);
+ VERIFY (d128 < a);
+}
+
+void
+compare_le_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+
+ a = si; VERIFY (a <= si); VERIFY (si <= a);
+ a = ui; VERIFY (a <= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a <= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a <= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a <= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a <= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a <= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a <= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a <= d128); VERIFY (d128 <= a);
+
+ a = -100;
+ VERIFY (a <= si);
+ VERIFY (a <= ui);
+ VERIFY (a <= sl);
+ VERIFY (a <= ul);
+ VERIFY (a <= sll);
+ VERIFY (a <= ull);
+ VERIFY (a <= d32);
+ VERIFY (a <= d64);
+ VERIFY (a <= d128);
+
+ a = 100;
+ VERIFY (si <= a);
+ VERIFY (ui <= a);
+ VERIFY (sl <= a);
+ VERIFY (ul <= a);
+ VERIFY (sll <= a);
+ VERIFY (ull <= a);
+ VERIFY (d32 <= a);
+ VERIFY (d64 <= a);
+ VERIFY (d128 <= a);
+}
+
+void
+compare_gt_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a = 100;
+
+ VERIFY (a > si);
+ VERIFY (a > ui);
+ VERIFY (a > sl);
+ VERIFY (a > ul);
+ VERIFY (a > sll);
+ VERIFY (a > ull);
+ VERIFY (a > d32);
+ VERIFY (a > d64);
+ VERIFY (a > d128);
+
+ a = -100;
+ VERIFY (si > a);
+ VERIFY (ui > a);
+ VERIFY (sl > a);
+ VERIFY (ul > a);
+ VERIFY (sll > a);
+ VERIFY (ull > a);
+ VERIFY (d32 > a);
+ VERIFY (d64 > a);
+ VERIFY (d128 > a);
+}
+
+void
+compare_ge_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+
+ a = si; VERIFY (a >= si); VERIFY (si <= a);
+ a = ui; VERIFY (a >= ui); VERIFY (ui <= a);
+ a = sl; VERIFY (a >= sl); VERIFY (sl <= a);
+ a = ul; VERIFY (a >= ul); VERIFY (ul <= a);
+ a = sll; VERIFY (a >= sll); VERIFY (sll <= a);
+ a = ull; VERIFY (a >= ull); VERIFY (ull <= a);
+ a = d32; VERIFY (a >= d32); VERIFY (d32 <= a);
+ a = (decimal32)d64; VERIFY (a >= d64); VERIFY (d64 <= a);
+ a = (decimal32)d128; VERIFY (a >= d128); VERIFY (d128 <= a);
+
+ a = 100;
+ VERIFY (a >= si);
+ VERIFY (a >= ui);
+ VERIFY (a >= sl);
+ VERIFY (a >= ul);
+ VERIFY (a >= sll);
+ VERIFY (a >= ull);
+ VERIFY (a >= d32);
+ VERIFY (a >= d64);
+ VERIFY (a >= d128);
+
+ a = -100;
+ VERIFY (si >= a);
+ VERIFY (ui >= a);
+ VERIFY (sl >= a);
+ VERIFY (ul >= a);
+ VERIFY (sll >= a);
+ VERIFY (ull >= a);
+ VERIFY (d32 >= a);
+ VERIFY (d64 >= a);
+ VERIFY (d128 >= a);
+}
+
+int
+main ()
+{
+ compare_eq_32 ();
+ compare_ne_32 ();
+ compare_lt_32 ();
+ compare_le_32 ();
+ compare_gt_32 ();
+ compare_ge_32 ();
+
+ compare_eq_64 ();
+ compare_ne_64 ();
+ compare_lt_64 ();
+ compare_le_64 ();
+ compare_gt_64 ();
+ compare_ge_64 ();
+
+ compare_eq_128 ();
+ compare_ne_128 ();
+ compare_lt_128 ();
+ compare_le_128 ();
+ compare_gt_128 ();
+ compare_ge_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
new file mode 100644
index 000000000..f38d3aa12
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
@@ -0,0 +1,262 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.6 Compound assignment (decimal32).
+// ISO/IEC TR 24733 3.2.3.6 Compound assignment (decimal64).
+// ISO/IEC TR 24733 3.2.4.6 Compound assignment (decimal128).
+
+// Access member functions directly.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -2;
+unsigned int ui = 5;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compound_assignment_add_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b.operator+=(d32); VERIFY (b == 1005);
+ b = a; b.operator+=(d64); VERIFY (b == 990);
+ b = a; b.operator+=(d128); VERIFY (b == 1025);
+ b = a; b.operator+=(si); VERIFY (b == 998);
+ b = a; b.operator+=(ui); VERIFY (b == 1005);
+ b = a; b.operator+=(sl); VERIFY (b == 990);
+ b = a; b.operator+=(ul); VERIFY (b == 1020);
+ b = a; b.operator+=(sll); VERIFY (b == 975);
+ b = a; b.operator+=(ull); VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b.operator-=(d32); VERIFY (b == 995);
+ b = a; b.operator-=(d64); VERIFY (b == 1010);
+ b = a; b.operator-=(d128); VERIFY (b == 975);
+ b = a; b.operator-=(si); VERIFY (b == 1002);
+ b = a; b.operator-=(ui); VERIFY (b == 995);
+ b = a; b.operator-=(sl); VERIFY (b == 1010);
+ b = a; b.operator-=(ul); VERIFY (b == 980);
+ b = a; b.operator-=(sll); VERIFY (b == 1025);
+ b = a; b.operator-=(ull); VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b.operator*=(d32); VERIFY (b == 5000);
+ b = a; b.operator*=(d64); VERIFY (b == -10000);
+ b = a; b.operator*=(d128); VERIFY (b == 25000);
+ b = a; b.operator*=(si); VERIFY (b == -2000);
+ b = a; b.operator*=(ui); VERIFY (b == 5000);
+ b = a; b.operator*=(sl); VERIFY (b == -10000);
+ b = a; b.operator*=(ul); VERIFY (b == 20000);
+ b = a; b.operator*=(sll); VERIFY (b == -25000);
+ b = a; b.operator*=(ull); VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b.operator/=(d32); VERIFY (b == 200);
+ b = a; b.operator/=(d64); VERIFY (b == -100);
+ b = a; b.operator/=(d128); VERIFY (b == 40);
+ b = a; b.operator/=(si); VERIFY (b == -500);
+ b = a; b.operator/=(ui); VERIFY (b == 200);
+ b = a; b.operator/=(sl); VERIFY (b == -100);
+ b = a; b.operator/=(ul); VERIFY (b == 50);
+ b = a; b.operator/=(sll); VERIFY (b == -40);
+ b = a; b.operator/=(ull); VERIFY (b == 20);
+}
+
+int
+main ()
+{
+ compound_assignment_add_32 ();
+ compound_assignment_subtract_32 ();
+ compound_assignment_multiply_32 ();
+ compound_assignment_divide_32 ();
+
+ compound_assignment_add_64 ();
+ compound_assignment_subtract_64 ();
+ compound_assignment_multiply_64 ();
+ compound_assignment_divide_64 ();
+
+ compound_assignment_add_128 ();
+ compound_assignment_subtract_128 ();
+ compound_assignment_multiply_128 ();
+ compound_assignment_divide_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment.cc
new file mode 100644
index 000000000..33a2d9cf0
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/compound-assignment.cc
@@ -0,0 +1,260 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.6 Compound assignment (decimal32).
+// ISO/IEC TR 24733 3.2.3.6 Compound assignment (decimal64).
+// ISO/IEC TR 24733 3.2.4.6 Compound assignment (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 d32 (5);
+decimal64 d64 (-10);
+decimal128 d128 (25);
+int si = -2;
+unsigned int ui = 5;
+long sl = -10;
+unsigned long ul = 20;
+long long sll = -25;
+unsigned long long ull = 50;
+
+void
+compound_assignment_add_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+void
+compound_assignment_add_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b += d32; VERIFY (b == 1005);
+ b = a; b += d64; VERIFY (b == 990);
+ b = a; b += d128; VERIFY (b == 1025);
+ b = a; b += si; VERIFY (b == 998);
+ b = a; b += ui; VERIFY (b == 1005);
+ b = a; b += sl; VERIFY (b == 990);
+ b = a; b += ul; VERIFY (b == 1020);
+ b = a; b += sll; VERIFY (b == 975);
+ b = a; b += ull; VERIFY (b == 1050);
+}
+
+void
+compound_assignment_subtract_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b -= d32; VERIFY (b == 995);
+ b = a; b -= d64; VERIFY (b == 1010);
+ b = a; b -= d128; VERIFY (b == 975);
+ b = a; b -= si; VERIFY (b == 1002);
+ b = a; b -= ui; VERIFY (b == 995);
+ b = a; b -= sl; VERIFY (b == 1010);
+ b = a; b -= ul; VERIFY (b == 980);
+ b = a; b -= sll; VERIFY (b == 1025);
+ b = a; b -= ull; VERIFY (b == 950);
+}
+
+void
+compound_assignment_multiply_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b *= d32; VERIFY (b == 5000);
+ b = a; b *= d64; VERIFY (b == -10000);
+ b = a; b *= d128; VERIFY (b == 25000);
+ b = a; b *= si; VERIFY (b == -2000);
+ b = a; b *= ui; VERIFY (b == 5000);
+ b = a; b *= sl; VERIFY (b == -10000);
+ b = a; b *= ul; VERIFY (b == 20000);
+ b = a; b *= sll; VERIFY (b == -25000);
+ b = a; b *= ull; VERIFY (b == 50000);
+}
+
+void
+compound_assignment_divide_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a (1000), b;
+
+ b = a; b /= d32; VERIFY (b == 200);
+ b = a; b /= d64; VERIFY (b == -100);
+ b = a; b /= d128; VERIFY (b == 40);
+ b = a; b /= si; VERIFY (b == -500);
+ b = a; b /= ui; VERIFY (b == 200);
+ b = a; b /= sl; VERIFY (b == -100);
+ b = a; b /= ul; VERIFY (b == 50);
+ b = a; b /= sll; VERIFY (b == -40);
+ b = a; b /= ull; VERIFY (b == 20);
+}
+
+int
+main ()
+{
+ compound_assignment_add_32 ();
+ compound_assignment_subtract_32 ();
+ compound_assignment_multiply_32 ();
+ compound_assignment_divide_32 ();
+
+ compound_assignment_add_64 ();
+ compound_assignment_subtract_64 ();
+ compound_assignment_multiply_64 ();
+ compound_assignment_divide_64 ();
+
+ compound_assignment_add_128 ();
+ compound_assignment_subtract_128 ();
+ compound_assignment_multiply_128 ();
+ compound_assignment_divide_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-float.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-float.cc
new file mode 100644
index 000000000..82d1d7071
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-float.cc
@@ -0,0 +1,104 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.2 Conversion from floating-point type (decimal32).
+// ISO/IEC TR 24733 3.2.3.2 Conversion from floating-point type (decimal64).
+// ISO/IEC TR 24733 3.2.4.2 Conversion from floating-point type (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_from_float_32 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d32 = (decimal32) d64;
+ VERIFY (d32 == make_decimal32 (234LL, 0));
+ d32 = (decimal32) d128;
+ VERIFY (d32 == make_decimal32 (345LL, 0));
+ d32 = (decimal32) f;
+ VERIFY (d32 == make_decimal32 (456LL, 0));
+ d32 = (decimal32) d;
+ VERIFY (d32 == make_decimal32 (567LL, 0));
+ d32 = (decimal32) ld;
+ VERIFY (d32 == make_decimal32 (678LL, 0));
+}
+
+void
+conversion_from_float_64 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d64 = d32;
+ VERIFY (d64 == make_decimal64 (123LL, 0));
+ d64 = (decimal64) d128;
+ VERIFY (d64 == make_decimal64 (345LL, 0));
+ d64 = (decimal64) f;
+ VERIFY (d64 == make_decimal64 (456LL, 0));
+ d64 = (decimal64) d;
+ VERIFY (d64 == make_decimal64 (567LL, 0));
+ d64 = (decimal64) ld;
+ VERIFY (d64 == make_decimal64 (678LL, 0));
+}
+
+void
+conversion_from_float_128 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d32(123);
+ decimal64 d64(234);
+ decimal128 d128(345);
+ float f = 456.F;
+ double d = 567.;
+ long double ld = 678.L;
+
+ d128 = d32;
+ VERIFY (d128 == make_decimal128 (123LL, 0));
+ d128 = d64;
+ VERIFY (d128 == make_decimal128 (234LL, 0));
+ d128 = (decimal128) f;
+ VERIFY (d128 == make_decimal128 (456LL, 0));
+ d128 = (decimal128) d;
+ VERIFY (d128 == make_decimal128 (567LL, 0));
+ d128 = (decimal128) ld;
+ VERIFY (d128 == make_decimal128 (678LL, 0));
+}
+
+int
+main ()
+{
+ conversion_from_float_32 ();
+ conversion_from_float_64 ();
+ conversion_from_float_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc
new file mode 100644
index 000000000..da76eecf1
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-from-integral.cc
@@ -0,0 +1,199 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.3 Conversion from integral type (decimal32).
+// ISO/IEC TR 24733 3.2.3.3 Conversion from integral type (decimal64).
+// ISO/IEC TR 24733 3.2.4.3 Conversion from integral type (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_from_integral_p32 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d;
+ decimal32 from_si (1);
+ decimal32 from_ui (2U);
+ decimal32 from_sl (3L);
+ decimal32 from_ul (4UL);
+ decimal32 from_sll (5LL);
+ decimal32 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+ d++; VERIFY (from_ull == d);
+}
+
+void
+conversion_from_integral_m32 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d;
+ decimal32 from_si (-1);
+ decimal32 from_sl (-2L);
+ decimal32 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+void
+conversion_from_integral_p64 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 d;
+ decimal64 from_si (1);
+ decimal64 from_ui (2U);
+ decimal64 from_sl (3L);
+ decimal64 from_ul (4UL);
+ decimal64 from_sll (5LL);
+ decimal64 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+ d++; VERIFY (from_ull == d);
+}
+
+void
+conversion_from_integral_m64 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 d;
+ decimal64 from_si (-1);
+ decimal64 from_sl (-2L);
+ decimal64 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+void
+conversion_from_integral_p128 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 d;
+ decimal128 from_si (1);
+ decimal128 from_ui (2U);
+ decimal128 from_sl (3L);
+ decimal128 from_ul (4UL);
+ decimal128 from_sll (5LL);
+ decimal128 from_ull (6ULL);
+
+ d++; VERIFY (from_si == d);
+ d++; VERIFY (from_ui == d);
+ d++; VERIFY (from_sl == d);
+ d++; VERIFY (from_ul == d);
+ d++; VERIFY (from_sll == d);
+ d++; VERIFY (from_ull == d);
+
+ from_si = 7;
+ d++; VERIFY (from_si == d);
+ from_ui = 8U;
+ d++; VERIFY (from_ui == d);
+ from_sl = 9L;
+ d++; VERIFY (from_sl == d);
+ from_ul = 10UL;
+ d++; VERIFY (from_ul == d);
+ from_sll = 11LL;
+ d++; VERIFY (from_sll == d);
+ from_ull = 12ULL;
+}
+
+void
+conversion_from_integral_m128 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 d;
+ decimal128 from_si (-1);
+ decimal128 from_sl (-2L);
+ decimal128 from_sll (-3LL);
+
+ d--; VERIFY (from_si == d);
+ d--; VERIFY (from_sl == d);
+ d--; VERIFY (from_sll == d);
+
+ from_si = -4;
+ d--; VERIFY (from_si == d);
+ from_sl = -5L;
+ d--; VERIFY (from_sl == d);
+ from_sll = -6LL;
+ d--; VERIFY (from_sll == d);
+}
+
+int
+main ()
+{
+ conversion_from_integral_p32 ();
+ conversion_from_integral_m32 ();
+ conversion_from_integral_p64 ();
+ conversion_from_integral_m64 ();
+ conversion_from_integral_p128 ();
+ conversion_from_integral_m128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc
new file mode 100644
index 000000000..add160bee
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc
@@ -0,0 +1,108 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.6 Conversion to generic floating-point type.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+conversion_to_generic_float_32 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 d32(123);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal32_to_float (d32);
+ VERIFY (f == 123.F);
+ d = decimal32_to_double (d32);
+ VERIFY (d == 123.);
+ ld = decimal32_to_long_double (d32);
+ VERIFY (ld == 123.L);
+
+ d32++;
+ f = decimal_to_float (d32);
+ VERIFY (f == 124.F);
+ d = decimal_to_double (d32);
+ VERIFY (d == 124.);
+ ld = decimal_to_long_double (d32);
+ VERIFY (ld == 124.L);
+}
+
+void
+conversion_to_generic_float_64 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 d64(234);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal64_to_float (d64);
+ VERIFY (f == 234.F);
+ d = decimal64_to_double (d64);
+ VERIFY (d == 234.);
+ ld = decimal64_to_long_double (d64);
+ VERIFY (ld == 234.L);
+
+ d64++;
+ f = decimal_to_float (d64);
+ VERIFY (f == 235.F);
+ d = decimal_to_double (d64);
+ VERIFY (d == 235.);
+ ld = decimal_to_long_double (d64);
+ VERIFY (ld == 235.L);
+}
+
+void
+conversion_to_generic_float_128 ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 d128(345);
+ float f;
+ double d;
+ long double ld;
+
+ f = decimal128_to_float (d128);
+ VERIFY (f == 345.F);
+ d = decimal128_to_double (d128);
+ VERIFY (d == 345.);
+ ld = decimal128_to_long_double (d128);
+ VERIFY (ld == 345.L);
+
+ d128++;
+ f = decimal_to_float (d128);
+ VERIFY (f == 346.F);
+ d = decimal_to_double (d128);
+ VERIFY (d == 346.);
+ ld = decimal_to_long_double (d128);
+ VERIFY (ld == 346.L);
+}
+
+int
+main ()
+{
+ conversion_to_generic_float_32 ();
+ conversion_to_generic_float_64 ();
+ conversion_to_generic_float_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc
new file mode 100644
index 000000000..109cc607b
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/conversion-to-integral.cc
@@ -0,0 +1,87 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.4 Conversion to integral type (decimal32).
+// ISO/IEC TR 24733 3.2.3.4 Conversion to integral type (decimal64).
+// ISO/IEC TR 24733 3.2.4.4 Conversion to integral type (decimal128).
+
+#include <decimal/decimal>
+#include <climits>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+conversion_to_integral_32 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL 999999LL
+ bool test __attribute__((unused)) = true;
+ decimal32 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+void
+conversion_to_integral_64 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL 999999999999999LL
+ bool test __attribute__((unused)) = true;
+ decimal64 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+void
+conversion_to_integral_128 (void)
+{
+ #undef MAXVAL
+ #define MAXVAL LONG_LONG_MAX
+ bool test __attribute__((unused)) = true;
+ decimal128 a, b (1), c (-1), d (MAXVAL), e (-MAXVAL);
+ long long ll;
+
+ ll = LONGLONG (a); VERIFY (ll == 0LL);
+ ll = LONGLONG (b); VERIFY (ll == 1LL);
+ ll = LONGLONG (c); VERIFY (ll == -1LL);
+ ll = LONGLONG (d); VERIFY (ll == MAXVAL);
+ ll = LONGLONG (e); VERIFY (ll == -MAXVAL);
+}
+
+int
+main ()
+{
+ conversion_to_integral_32 ();
+ conversion_to_integral_64 ();
+ conversion_to_integral_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/ctor.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/ctor.cc
new file mode 100644
index 000000000..dae644dd2
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/ctor.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.1 Construct/copy/destroy (decimal32).
+// ISO/IEC TR 24733 3.2.3.1 Construct/copy/destroy (decimal64).
+// ISO/IEC TR 24733 3.2.4.1 Construct/copy/destroy (decimal128).
+
+// Test the default constructor.
+
+#include <decimal/decimal>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+void
+ctor_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+ float b __attribute__((mode(SD))) = 0.e-101DF;
+
+ VERIFY (std::memcmp (&a, &b, 4) == 0);
+}
+
+void
+ctor_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+ float b __attribute__((mode(DD))) = 0.e-398DD;
+
+ VERIFY (std::memcmp (&a, &b, 8) == 0);
+}
+
+void
+ctor_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+ float b __attribute__((mode(TD))) = 0.e-6176DL;
+
+ VERIFY (std::memcmp (&a, &b, 16) == 0);
+}
+
+int
+main ()
+{
+ ctor_32 ();
+ ctor_64 ();
+ ctor_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc
new file mode 100644
index 000000000..5afa06f90
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec-memfunc.cc
@@ -0,0 +1,184 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.5 Increment and decrement operators (decimal32).
+// ISO/IEC TR 24733 3.2.3.5 Increment and decrement operators (decimal64).
+// ISO/IEC TR 24733 3.2.4.5 Increment and decrement operators (decimal128).
+
+// Access member functions directly.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+incdec32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal32 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal64 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal128 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ b.operator++();
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator++(1);
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b.operator--();
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b.operator--(1);
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = b.operator++();
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b.operator++(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = b.operator--();
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b.operator--(1);
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+int
+main ()
+{
+ incdec32 ();
+ incdec64 ();
+ incdec128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec.cc
new file mode 100644
index 000000000..32a6ceaaf
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/incdec.cc
@@ -0,0 +1,182 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.2.5 Increment and decrement operators (decimal32).
+// ISO/IEC TR 24733 3.2.3.5 Increment and decrement operators (decimal64).
+// ISO/IEC TR 24733 3.2.4.5 Increment and decrement operators (decimal128).
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+// Use extension to replace implicit long long conversion with function call.
+#define LONGLONG(X) decimal_to_long_long(X)
+
+using namespace std::decimal;
+
+void
+incdec32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal32 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal64 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+void
+incdec128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ int ival;
+ decimal128 a(11), b, c;
+
+ // Verify that we get the expected value of b after assignment.
+ b = a;
+ ival = LONGLONG (b); VERIFY (ival == 11);
+
+ // Check that the increment and decrement operators change the value
+ // of the original class.
+ b = a;
+ ++b;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ b++;
+ ival = LONGLONG (b); VERIFY (ival == 12);
+
+ b = a;
+ --b;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ b = a;
+ b--;
+ ival = LONGLONG (b); VERIFY (ival == 10);
+
+ // Check that the increment and decrement operators return the
+ // correct value.
+ b = a;
+ c = ++b;
+ ival = LONGLONG (c); VERIFY (ival == 12);
+
+ b = a;
+ c = b++;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+
+ b = a;
+ c = --b;
+ ival = LONGLONG (c); VERIFY (ival == 10);
+
+ b = a;
+ c = b--;
+ ival = LONGLONG (c); VERIFY (ival == 11);
+}
+
+int
+main ()
+{
+ incdec32 ();
+ incdec64 ();
+ incdec128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/make-decimal.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/make-decimal.cc
new file mode 100644
index 000000000..1ccb20805
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/make-decimal.cc
@@ -0,0 +1,135 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.5 Initialization from coefficient and exponent.
+
+#include <decimal/decimal>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+#define PASTE2(A,B) A ## B
+#define PASTE(A,B) PASTE2(A,B)
+
+#define TESTVAL_NEG(COEFF,ESIGN,EXP,SUF,NUM,SIZE) \
+ x = PASTE(PASTE(PASTE(PASTE(PASTE(COEFF,.),E),ESIGN),EXP),SUF); \
+ sll = PASTE(COEFF,LL); \
+ i = ESIGN EXP; \
+ a = PASTE(make_decimal,32) (sll, i); \
+ b = PASTE(make_decimal,32) (PASTE(COEFF,LL), ESIGN EXP); \
+ VERIFY ((std::memcmp ((void *)&x, (void *)&a, SIZE) == 0) \
+ && (std::memcmp ((void *)&x, (void *)&b,SIZE) == 0));
+
+#define TESTVAL_NONNEG(COEFF,ESIGN,EXP,SUF,NUM,SIZE) \
+ x = PASTE(PASTE(PASTE(PASTE(PASTE(COEFF,.),E),ESIGN),EXP),SUF); \
+ sll = PASTE(COEFF,LL); \
+ ull = PASTE(COEFF,ULL); \
+ i = ESIGN EXP; \
+ a = PASTE(make_decimal,32) (sll, i); \
+ b = PASTE(make_decimal,32) (PASTE(COEFF,LL), ESIGN EXP); \
+ c = PASTE(make_decimal,32) (ull, i); \
+ d = PASTE(make_decimal,32) (PASTE(COEFF,ULL), ESIGN EXP); \
+ VERIFY ((std::memcmp ((void *)&x, (void *)&a, SIZE) == 0) \
+ && (std::memcmp ((void *)&x, (void *)&b,SIZE) == 0) \
+ && (std::memcmp ((void *)&x, (void *)&c,SIZE) == 0) \
+ && (std::memcmp ((void *)&x, (void *)&d,SIZE) == 0));
+
+using namespace std::decimal;
+
+void
+make_decimal_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a, b, c, d;
+ float x __attribute__((mode(SD)));
+ int i;
+ unsigned long sz = sizeof (decimal32);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 32, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 32, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 32, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 32, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 32, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 32, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 32, sz);
+}
+
+void
+make_decimal_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a, b, c, d;
+ float x __attribute__((mode(DD)));
+ int i;
+ unsigned long sz = sizeof (decimal64);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 64, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 64, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 64, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 64, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 64, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 64, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 64, sz);
+}
+
+void
+make_decimal_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a, b, c, d;
+ float x __attribute__((mode(TD)));
+ int i;
+ unsigned long sz = sizeof (decimal128);
+ volatile long long sll;
+ volatile unsigned long long ull;
+
+ TESTVAL_NONNEG (0, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (5, +, 1, DF, 128, sz);
+ TESTVAL_NONNEG (50, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (500, +, 0, DF, 128, sz);
+ TESTVAL_NEG (-25, -, 3, DF, 128, sz)
+ TESTVAL_NEG (-500, +, 0, DF, 128, sz);
+ TESTVAL_NONNEG (999999, +, 91, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 9, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 90, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 95, DF, 128, sz);
+ TESTVAL_NONNEG (1, -, 101, DF, 128, sz);
+ TESTVAL_NEG (-1, -, 101, DF, 128, sz);
+}
+
+int
+main ()
+{
+ make_decimal_32 ();
+ make_decimal_64 ();
+ make_decimal_128 ();
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-arith_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-arith_neg.cc
new file mode 100644
index 000000000..6b5423dc1
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-arith_neg.cc
@@ -0,0 +1,138 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// Test that binary arithmetic operators do not accept mixed decimal
+// and generic floating-point operands. This isn't explicity
+// prohibited in ISO/IEC TR 24733 but it is prohibited in C, and in C++
+// there should not be an implicit conversion from a decimal
+// floating-point type to a generic floating-point type.
+
+#include <decimal/decimal>
+
+using namespace std::decimal;
+
+decimal32 a32, b32, c32;
+decimal64 a64, b64, c64;
+decimal128 a128, b128, c128;
+float f;
+double d;
+long double ld;
+bool b1, b2, b3, b4, b5, b6;
+
+void
+bad_add (void)
+{
+ a32 = b32 + f; // { dg-error "error" }
+ a32 = ld + b32; // { dg-error "error" }
+ a64 = b64 + d; // { dg-error "error" }
+ a64 = ld + b64; // { dg-error "error" }
+ a128 = b128 + ld; // { dg-error "error" }
+ a128 = d + b128; // { dg-error "error" }
+}
+
+void
+bad_subtract (void)
+{
+ a32 = b32 - f; // { dg-error "error" }
+ a32 = ld - b32; // { dg-error "error" }
+ a64 = b64 - d; // { dg-error "error" }
+ a64 = ld - b64; // { dg-error "error" }
+ a128 = b128 - ld; // { dg-error "error" }
+ a128 = d - b128; // { dg-error "error" }
+}
+
+void
+bad_multiply (void)
+{
+ a32 = b32 * f; // { dg-error "error" }
+ a32 = ld * b32; // { dg-error "error" }
+ a64 = b64 * d; // { dg-error "error" }
+ a64 = ld * b64; // { dg-error "error" }
+ a128 = b128 * ld; // { dg-error "error" }
+ a128 = d * b128; // { dg-error "error" }
+}
+
+void
+bad_divide (void)
+{
+ a32 = b32 / f; // { dg-error "error" }
+ a32 = ld / b32; // { dg-error "error" }
+ a64 = b64 / d; // { dg-error "error" }
+ a64 = ld / b64; // { dg-error "error" }
+ a128 = b128 / ld; // { dg-error "error" }
+ a128 = d / b128; // { dg-error "error" }
+}
+
+void
+bad_pluseq (void)
+{
+ a32 += f; // { dg-error "error" }
+ a32 += d; // { dg-error "error" }
+ a32 += ld; // { dg-error "error" }
+ a64 += f; // { dg-error "error" }
+ a64 += d; // { dg-error "error" }
+ a64 += ld; // { dg-error "error" }
+ a128 += f; // { dg-error "error" }
+ a128 += d; // { dg-error "error" }
+ a128 += ld; // { dg-error "error" }
+}
+
+void
+bad_minuseq (void)
+{
+ a32 -= f; // { dg-error "error" }
+ a32 -= d; // { dg-error "error" }
+ a32 -= ld; // { dg-error "error" }
+ a64 -= f; // { dg-error "error" }
+ a64 -= d; // { dg-error "error" }
+ a64 -= ld; // { dg-error "error" }
+ a128 -= f; // { dg-error "error" }
+ a128 -= d; // { dg-error "error" }
+ a128 -= ld; // { dg-error "error" }
+}
+
+void
+bad_timeseq (void)
+{
+ a32 *= f; // { dg-error "error" }
+ a32 *= d; // { dg-error "error" }
+ a32 *= ld; // { dg-error "error" }
+ a64 *= f; // { dg-error "error" }
+ a64 *= d; // { dg-error "error" }
+ a64 *= ld; // { dg-error "error" }
+ a128 *= f; // { dg-error "error" }
+ a128 *= d; // { dg-error "error" }
+ a128 *= ld; // { dg-error "error" }
+}
+
+void
+bad_divideeq (void)
+{
+ a32 /= f; // { dg-error "error" }
+ a32 /= d; // { dg-error "error" }
+ a32 /= ld; // { dg-error "error" }
+ a64 /= f; // { dg-error "error" }
+ a64 /= d; // { dg-error "error" }
+ a64 /= ld; // { dg-error "error" }
+ a128 /= f; // { dg-error "error" }
+ a128 /= d; // { dg-error "error" }
+ a128 /= ld; // { dg-error "error" }
+}
+
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-cmp_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-cmp_neg.cc
new file mode 100644
index 000000000..6dd642822
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/mixed-mode-cmp_neg.cc
@@ -0,0 +1,104 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// Test that binary comparison operators do not accept mixed decimal
+// and generic floating-point operands. This isn't explicity prohibited
+// in ISO/IEC TR 24733 but it is prohibited in C, and in C++ there should
+// not be an implicit conversion from a decimal floating-point type to a
+// generic floating-point type.
+
+#include <decimal/decimal>
+
+using namespace std::decimal;
+
+decimal32 a32, b32, c32;
+decimal64 a64, b64, c64;
+decimal128 a128, b128, c128;
+float f;
+double d;
+long double ld;
+bool b1, b2, b3, b4, b5, b6;
+
+void
+bad_eq (void)
+{
+ b1 = b32 == f; // { dg-error "error" }
+ b2 = ld == b32; // { dg-error "error" }
+ b3 = b64 == d; // { dg-error "error" }
+ b4 = ld == b64; // { dg-error "error" }
+ b5 = b128 == ld; // { dg-error "error" }
+ b6 = d == b128; // { dg-error "error" }
+}
+
+void
+bad_ne (void)
+{
+ b1 = b32 != f; // { dg-error "error" }
+ b2 = ld != b32; // { dg-error "error" }
+ b3 = b64 != d; // { dg-error "error" }
+ b4 = ld != b64; // { dg-error "error" }
+ b5 = b128 != ld; // { dg-error "error" }
+ b6 = d != b128; // { dg-error "error" }
+}
+
+void
+bad_lt (void)
+{
+ b1 = b32 < f; // { dg-error "error" }
+ b2 = ld < b32; // { dg-error "error" }
+ b3 = b64 < d; // { dg-error "error" }
+ b4 = ld < b64; // { dg-error "error" }
+ b5 = b128 < ld; // { dg-error "error" }
+ b6 = d < b128; // { dg-error "error" }
+}
+
+void
+bad_le (void)
+{
+ b1 = b32 <= f; // { dg-error "error" }
+ b2 = ld <= b32; // { dg-error "error" }
+ b3 = b64 <= d; // { dg-error "error" }
+ b4 = ld <= b64; // { dg-error "error" }
+ b5 = b128 <= ld; // { dg-error "error" }
+ b6 = d <= b128; // { dg-error "error" }
+}
+
+void
+bad_gt (void)
+{
+ b1 = b32 > f; // { dg-error "error" }
+ b2 = ld > b32; // { dg-error "error" }
+ b3 = b64 > d; // { dg-error "error" }
+ b4 = ld > b64; // { dg-error "error" }
+ b5 = b128 > ld; // { dg-error "error" }
+ b6 = d > b128; // { dg-error "error" }
+}
+
+void
+bad_ge (void)
+{
+ b1 = b32 >= f; // { dg-error "error" }
+ b2 = ld >= b32; // { dg-error "error" }
+ b3 = b64 >= d; // { dg-error "error" }
+ b4 = ld >= b64; // { dg-error "error" }
+ b5 = b128 >= ld; // { dg-error "error" }
+ b6 = d >= b128; // { dg-error "error" }
+}
+
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/operator_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/operator_neg.cc
new file mode 100644
index 000000000..d1dfcc5f7
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/operator_neg.cc
@@ -0,0 +1,159 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+// Test that C++ binary operators that are restricted to integer operands
+// do not accept decimal float operands.
+
+#include <decimal/decimal>
+
+using namespace std::decimal;
+
+decimal32 a32, b32, c32;
+decimal64 a64, b64, c64;
+decimal128 a128, b128, c128;
+
+void
+modulus (void)
+{
+ a32 = b32 % c32; // { dg-error "error" }
+ a64 = b64 % c64; // { dg-error "error" }
+ a128 = b128 % c128; // { dg-error "error" }
+ a128 = b32 % c128; // { dg-error "error" }
+ a128 = b64 % c128; // { dg-error "error" }
+ a32 = 100 % c32; // { dg-error "error" }
+ a64 = 10 % c64; // { dg-error "error" }
+ a128 = 1000 % c128; // { dg-error "error" }
+ a32 = b32 % 7; // { dg-error "error" }
+ a64 = b64 % 5; // { dg-error "error" }
+ a128 = b128 % 3; // { dg-error "error" }
+}
+
+void
+bitwise_right_shift (void)
+{
+ a32 = b32 >> c32; // { dg-error "error" }
+ a64 = b64 >> c64; // { dg-error "error" }
+ a128 = b128 >> c128; // { dg-error "error" }
+ a128 = b32 >> c128; // { dg-error "error" }
+ a128 = b64 >> c128; // { dg-error "error" }
+ a32 = 100 >> c32; // { dg-error "error" }
+ a64 = 10 >> c64; // { dg-error "error" }
+ a128 = 1000 >> c128; // { dg-error "error" }
+ a32 = b32 >> 7; // { dg-error "error" }
+ a64 = b64 >> 5; // { dg-error "error" }
+ a128 = b128 >> 3; // { dg-error "error" }
+}
+
+void
+bitwise_left_shift (void)
+{
+ a32 = b32 << c32; // { dg-error "error" }
+ a64 = b64 << c64; // { dg-error "error" }
+ a128 = b128 << c128; // { dg-error "error" }
+ a128 = b32 << c128; // { dg-error "error" }
+ a128 = b64 << c128; // { dg-error "error" }
+ a32 = 100 << c32; // { dg-error "error" }
+ a64 = 10 << c64; // { dg-error "error" }
+ a128 = 1000 << c128; // { dg-error "error" }
+ a32 = b32 << 7; // { dg-error "error" }
+ a64 = b64 << 5; // { dg-error "error" }
+ a128 = b128 << 3; // { dg-error "error" }
+}
+
+void
+bitwise_exclusive_or (void)
+{
+ a32 = b32 ^ c32; // { dg-error "error" }
+ a64 = b64 ^ c64; // { dg-error "error" }
+ a128 = b128 ^ c128; // { dg-error "error" }
+ a128 = b32 ^ c128; // { dg-error "error" }
+ a128 = b64 ^ c128; // { dg-error "error" }
+ a32 = 100 ^ c32; // { dg-error "error" }
+ a64 = 10 ^ c64; // { dg-error "error" }
+ a128 = 1000 ^ c128; // { dg-error "error" }
+ a32 = b32 ^ 7; // { dg-error "error" }
+ a64 = b64 ^ 5; // { dg-error "error" }
+ a128 = b128 ^ 3; // { dg-error "error" }
+}
+
+void
+bitwise_inclusive_or (void)
+{
+ a32 = b32 | c32; // { dg-error "error" }
+ a64 = b64 | c64; // { dg-error "error" }
+ a128 = b128 | c128; // { dg-error "error" }
+ a128 = b32 | c128; // { dg-error "error" }
+ a128 = b64 | c128; // { dg-error "error" }
+ a32 = 100 | c32; // { dg-error "error" }
+ a64 = 10 | c64; // { dg-error "error" }
+ a128 = 1000 | c128; // { dg-error "error" }
+ a32 = b32 | 7; // { dg-error "error" }
+ a64 = b64 | 5; // { dg-error "error" }
+ a128 = b128 | 3; // { dg-error "error" }
+}
+
+void
+logical_and (void)
+{
+ a32 = b32 && c32; // { dg-error "error" }
+ a64 = b64 && c64; // { dg-error "error" }
+ a128 = b128 && c128; // { dg-error "error" }
+ a128 = b32 && c128; // { dg-error "error" }
+ a128 = b64 && c128; // { dg-error "error" }
+ a32 = 100 && c32; // { dg-error "error" }
+ a64 = 10 && c64; // { dg-error "error" }
+ a128 = 1000 && c128; // { dg-error "error" }
+ a32 = b32 && 7; // { dg-error "error" }
+ a64 = b64 && 5; // { dg-error "error" }
+ a128 = b128 && 3; // { dg-error "error" }
+}
+
+void
+logical_or (void)
+{
+ a32 = b32 || c32; // { dg-error "error" }
+ a64 = b64 || c64; // { dg-error "error" }
+ a128 = b128 || c128; // { dg-error "error" }
+ a128 = b32 || c128; // { dg-error "error" }
+ a128 = b64 || c128; // { dg-error "error" }
+ a32 = 100 || c32; // { dg-error "error" }
+ a64 = 10 || c64; // { dg-error "error" }
+ a128 = 1000 || c128; // { dg-error "error" }
+ a32 = b32 || 7; // { dg-error "error" }
+ a64 = b64 || 5; // { dg-error "error" }
+ a128 = b128 || 3; // { dg-error "error" }
+}
+
+void
+bitwise_complement (void)
+{
+ a32 = ~b32; // { dg-error "error" }
+ a64 = ~b64; // { dg-error "error" }
+ a128 = ~b128; // { dg-error "error" }
+}
+
+void
+logical_not (void)
+{
+ a32 = !b32; // { dg-error "error" }
+ a64 = !b64; // { dg-error "error" }
+ a128 = !b128; // { dg-error "error" }
+}
+
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-1.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-1.cc
new file mode 100644
index 000000000..2f306a66f
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-1.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2012-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32
+__attribute__ ((noinline))
+my_nan32 (void)
+{
+ decimal32 z = 0;
+ decimal32 v = z/z;
+ return v;
+}
+
+decimal32
+__attribute__ ((noinline))
+my_inf32 (void)
+{
+ decimal32 o = 1;
+ decimal32 z = 0;
+ decimal32 v = o/z;
+ return v;
+}
+
+int
+main ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 v;
+
+ v = my_nan32 ();
+
+ VERIFY (__builtin_isnand32 (v.__getval ()));
+ VERIFY (!__builtin_signbitd32 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isnand32 (v.__getval ()));
+ VERIFY (__builtin_signbitd32 (v.__getval ()));
+
+ v = my_inf32 ();
+
+ VERIFY (__builtin_isinfd32 (v.__getval ()));
+ VERIFY (!__builtin_signbitd32 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isinfd32 (v.__getval ()));
+ VERIFY (__builtin_signbitd32 (v.__getval ()));
+
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-2.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-2.cc
new file mode 100644
index 000000000..62ba13476
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-2.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2012-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal64
+__attribute__ ((noinline))
+my_nan64 (void)
+{
+ decimal64 z = 0;
+ decimal64 v = z/z;
+ return v;
+}
+
+decimal64
+__attribute__ ((noinline))
+my_inf64 (void)
+{
+ decimal64 o = 1;
+ decimal64 z = 0;
+ decimal64 v = o/z;
+ return v;
+}
+
+int
+main ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 v;
+
+ v = my_nan64 ();
+
+ VERIFY (__builtin_isnand64 (v.__getval ()));
+ VERIFY (!__builtin_signbitd64 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isnand64 (v.__getval ()));
+ VERIFY (__builtin_signbitd64 (v.__getval ()));
+
+ v = my_inf64 ();
+
+ VERIFY (__builtin_isinfd64 (v.__getval ()));
+ VERIFY (!__builtin_signbitd64 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isinfd64 (v.__getval ()));
+ VERIFY (__builtin_signbitd64 (v.__getval ()));
+
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-3.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-3.cc
new file mode 100644
index 000000000..0cb5ecbe7
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr54036-3.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2012-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal128
+__attribute__ ((noinline))
+my_nan128 (void)
+{
+ decimal128 z = 0;
+ decimal128 v = z/z;
+ return v;
+}
+
+decimal128
+__attribute__ ((noinline))
+my_inf128 (void)
+{
+ decimal128 o = 1;
+ decimal128 z = 0;
+ decimal128 v = o/z;
+ return v;
+}
+
+int
+main ()
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 v;
+
+ v = my_nan128 ();
+
+ VERIFY (__builtin_isnand128 (v.__getval ()));
+ VERIFY (!__builtin_signbitd128 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isnand128 (v.__getval ()));
+ VERIFY (__builtin_signbitd128 (v.__getval ()));
+
+ v = my_inf128 ();
+
+ VERIFY (__builtin_isinfd128 (v.__getval ()));
+ VERIFY (!__builtin_signbitd128 (v.__getval ()));
+
+ v = -v;
+
+ VERIFY (__builtin_isinfd128 (v.__getval ()));
+ VERIFY (__builtin_signbitd128 (v.__getval ()));
+
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/pr58815.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr58815.cc
new file mode 100644
index 000000000..92f675cf5
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/pr58815.cc
@@ -0,0 +1,35 @@
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-require-effective-target dfp }
+
+#include <decimal/decimal>
+
+void
+test01 ()
+{
+ std::decimal::decimal32 d32(0);
+ std::decimal::decimal64 d64(0);
+ std::decimal::decimal128 d128(0);
+
+ static_cast<long long>(d32);
+ static_cast<long long>(d64);
+ static_cast<long long>(d128);
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/decimal/unary-arith.cc b/gcc-4.9/libstdc++-v3/testsuite/decimal/unary-arith.cc
new file mode 100644
index 000000000..94eb9a322
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/decimal/unary-arith.cc
@@ -0,0 +1,99 @@
+// Copyright (C) 2009-2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-effective-target dfp }
+
+// ISO/IEC TR 24733 3.2.7 Unary arithmetic operators.
+
+#include <decimal/decimal>
+#include <testsuite_hooks.h>
+
+using namespace std::decimal;
+
+decimal32 a32 (20), b32 (-20);
+decimal64 a64 (124), b64 (-124);
+decimal128 a128 (5001), b128 (-5001);
+
+void
+unary_plus_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+
+ a = +a32; VERIFY (a == a32);
+ a = +b32; VERIFY (a == b32);
+}
+
+void
+unary_minus_32 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal32 a;
+
+ a = -a32; VERIFY (a == b32);
+ a = -b32; VERIFY (a == a32);
+}
+
+void
+unary_plus_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+
+ a = +a64; VERIFY (a == a64);
+ a = +b64; VERIFY (a == b64);
+}
+
+void
+unary_minus_64 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal64 a;
+
+ a = -a64; VERIFY (a == b64);
+ a = -b64; VERIFY (a == a64);
+}
+
+void
+unary_plus_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+
+ a = +a128; VERIFY (a == a128);
+ a = +b128; VERIFY (a == b128);
+}
+
+void
+unary_minus_128 (void)
+{
+ bool test __attribute__((unused)) = true;
+ decimal128 a;
+
+ a = -a128; VERIFY (a == b128);
+ a = -b128; VERIFY (a == a128);
+}
+
+int main ()
+{
+ unary_plus_32 ();
+ unary_minus_32 ();
+ unary_plus_64 ();
+ unary_minus_64 ();
+ unary_plus_128 ();
+ unary_minus_128 ();
+}