]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorPaolo Carlini <paolo@gcc.gnu.org>
Mon, 6 Aug 2012 18:06:42 +0000 (18:06 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 6 Aug 2012 18:06:42 +0000 (18:06 +0000)
2012-08-06  Paolo Carlini  <paolo.carlini@oracle.com>

* testsuite/decimal/mixed-mode-cmp_neg.cc: Add test variable; minor
tweaks.
* testsuite/decimal/unary-arith.cc: Likewise.
* testsuite/decimal/ctor.cc: Likewise.
* testsuite/decimal/conversion-to-integral.cc: Likewise.
* testsuite/decimal/make-decimal.cc: Likewise.
* testsuite/decimal/comparison.cc: Likewise.
* testsuite/decimal/incdec-memfunc.cc: Likewise.
* testsuite/decimal/conversion-to-generic-float.cc: Likewise.
* testsuite/decimal/compound-assignment-memfunc.cc: Likewise.
* testsuite/decimal/cast_neg.cc: Likewise.
* testsuite/decimal/incdec.cc: Likewise.
* testsuite/decimal/mixed-mode-arith_neg.cc: Likewise.
* testsuite/decimal/binary-arith.cc: Likewise.
* testsuite/decimal/conversion-from-float.cc: Likewise.
* testsuite/decimal/conversion-from-integral.cc: Likewise.
* testsuite/decimal/compound-assignment.cc: Likewise.

2012-08-06  Peter Bergner  <bergner@vnet.ibm.com>

PR libstdc++/54036
* include/decimal/decimal.h (_DEFINE_DECIMAL_UNARY_OP): Use _Op as
a unary operator.
* testsuite/decimal/pr54036-1.cc: New test.
* testsuite/decimal/pr54036-2.cc: Likewise.
* testsuite/decimal/pr54036-3.cc: Likewise.

From-SVN: r190186

21 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/decimal/decimal.h
libstdc++-v3/testsuite/decimal/binary-arith.cc
libstdc++-v3/testsuite/decimal/cast_neg.cc
libstdc++-v3/testsuite/decimal/comparison.cc
libstdc++-v3/testsuite/decimal/compound-assignment-memfunc.cc
libstdc++-v3/testsuite/decimal/compound-assignment.cc
libstdc++-v3/testsuite/decimal/conversion-from-float.cc
libstdc++-v3/testsuite/decimal/conversion-from-integral.cc
libstdc++-v3/testsuite/decimal/conversion-to-generic-float.cc
libstdc++-v3/testsuite/decimal/conversion-to-integral.cc
libstdc++-v3/testsuite/decimal/ctor.cc
libstdc++-v3/testsuite/decimal/incdec-memfunc.cc
libstdc++-v3/testsuite/decimal/incdec.cc
libstdc++-v3/testsuite/decimal/make-decimal.cc
libstdc++-v3/testsuite/decimal/mixed-mode-arith_neg.cc
libstdc++-v3/testsuite/decimal/mixed-mode-cmp_neg.cc
libstdc++-v3/testsuite/decimal/pr54036-1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/decimal/pr54036-2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/decimal/pr54036-3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/decimal/unary-arith.cc

index d247f5bf6bc022f7ffe2057855a5a7efcf5b1c09..3bd4ea39ef7a5762cdb7510d4fe0b2d838a21e94 100644 (file)
@@ -1,3 +1,32 @@
+2012-08-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * testsuite/decimal/mixed-mode-cmp_neg.cc: Add test variable; minor
+       tweaks.
+       * testsuite/decimal/unary-arith.cc: Likewise.
+       * testsuite/decimal/ctor.cc: Likewise.
+       * testsuite/decimal/conversion-to-integral.cc: Likewise.
+       * testsuite/decimal/make-decimal.cc: Likewise.
+       * testsuite/decimal/comparison.cc: Likewise.
+       * testsuite/decimal/incdec-memfunc.cc: Likewise.
+       * testsuite/decimal/conversion-to-generic-float.cc: Likewise.
+       * testsuite/decimal/compound-assignment-memfunc.cc: Likewise.
+       * testsuite/decimal/cast_neg.cc: Likewise.
+       * testsuite/decimal/incdec.cc: Likewise.
+       * testsuite/decimal/mixed-mode-arith_neg.cc: Likewise.
+       * testsuite/decimal/binary-arith.cc: Likewise.
+       * testsuite/decimal/conversion-from-float.cc: Likewise.
+       * testsuite/decimal/conversion-from-integral.cc: Likewise.
+       * testsuite/decimal/compound-assignment.cc: Likewise.
+
+2012-08-06  Peter Bergner  <bergner@vnet.ibm.com>
+
+       PR libstdc++/54036
+       * include/decimal/decimal.h (_DEFINE_DECIMAL_UNARY_OP): Use _Op as
+       a unary operator.
+       * testsuite/decimal/pr54036-1.cc: New test.
+       * testsuite/decimal/pr54036-2.cc: Likewise.
+       * testsuite/decimal/pr54036-3.cc: Likewise.
+
 2012-08-04  Paolo Carlini  <paolo.carlini@oracle.com>
 
        Revert:
index f8f05734ba8f76223a8bef40020518bade9913b0..6bc9e6a9300172a515406342a2211b4662da7b55 100644 (file)
@@ -288,7 +288,7 @@ namespace decimal
   inline _Tp operator _Op(_Tp __rhs)           \
   {                                            \
     _Tp __tmp;                                 \
-    __tmp.__setval(0 _Op __rhs.__getval());    \
+    __tmp.__setval(_Op __rhs.__getval());      \
     return __tmp;                              \
   }
 
index 180bca57167bf7e9b8e599afafd816dc54f672a8..d1bd1bc2d4777ef15050b5564f0f410a6c06974c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -37,6 +37,7 @@ 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);
@@ -63,6 +64,7 @@ binary_add_32 (void)
 void
 binary_subtract_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a - si;   VERIFY (b == 1020);
@@ -90,6 +92,7 @@ binary_subtract_32 (void)
 void
 binary_multiply_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a * si;   VERIFY (b == -20000);
@@ -116,6 +119,7 @@ binary_multiply_32 (void)
 void
 binary_divide_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a / si;   VERIFY (b == -50);
@@ -143,6 +147,7 @@ binary_divide_32 (void)
 void
 binary_add_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a + si;   VERIFY (b == 980);
@@ -169,6 +174,7 @@ binary_add_64 (void)
 void
 binary_subtract_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a - si;   VERIFY (b == 1020);
@@ -196,6 +202,7 @@ binary_subtract_64 (void)
 void
 binary_multiply_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a * si;   VERIFY (b == -20000);
@@ -222,6 +229,7 @@ binary_multiply_64 (void)
 void
 binary_divide_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a / si;   VERIFY (b == -50);
@@ -249,6 +257,7 @@ binary_divide_64 (void)
 void
 binary_add_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a + si;   VERIFY (b == 980);
@@ -275,6 +284,7 @@ binary_add_128 (void)
 void
 binary_subtract_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a - si;   VERIFY (b == 1020);
@@ -302,6 +312,7 @@ binary_subtract_128 (void)
 void
 binary_multiply_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a * si;   VERIFY (b == -20000);
@@ -328,6 +339,7 @@ binary_multiply_128 (void)
 void
 binary_divide_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a / si;   VERIFY (b == -50);
index 23749ba5e750cd0ebdb23c55c537c737b45cbbc6..4ecd15d3e90db32fff82707b83988a6ec99804b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -26,7 +26,6 @@
 // attempt to do a cast are flagged as errors.
 
 #include <decimal/decimal>
-#include <testsuite_hooks.h>
 
 using namespace std::decimal;
 
index 1efa637ac4aacf5ba22daef09de0702e6a0c6e3b..ff1e21eb300ce26db80c5a8425724a1dc4ccd289 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -37,6 +37,7 @@ 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);
@@ -53,6 +54,7 @@ compare_eq_32 (void)
 void
 compare_ne_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a = 100;
 
   VERIFY (a != si);   VERIFY (si != a);
@@ -69,6 +71,7 @@ compare_ne_32 (void)
 void
 compare_lt_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a = -100;
 
   VERIFY (a < si);
@@ -96,6 +99,7 @@ compare_lt_32 (void)
 void
 compare_le_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a;
 
   a = si;   VERIFY (a <= si);   VERIFY (si <= a);
@@ -134,6 +138,7 @@ compare_le_32 (void)
 void
 compare_gt_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a = 100;
 
   VERIFY (a > si);
@@ -161,6 +166,7 @@ compare_gt_32 (void)
 void
 compare_ge_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a;
 
   a = si;   VERIFY (a >= si);   VERIFY (si <= a);
@@ -199,6 +205,7 @@ compare_ge_32 (void)
 void
 compare_eq_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a;
 
   a = si;   VERIFY (a == si);   VERIFY (si == a);
@@ -215,6 +222,7 @@ compare_eq_64 (void)
 void
 compare_ne_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a = 100;
 
   VERIFY (a != si);   VERIFY (si != a);
@@ -231,6 +239,7 @@ compare_ne_64 (void)
 void
 compare_lt_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a = -100;
 
   VERIFY (a < si);
@@ -258,6 +267,7 @@ compare_lt_64 (void)
 void
 compare_le_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a;
 
   a = si;   VERIFY (a <= si);   VERIFY (si <= a);
@@ -296,6 +306,7 @@ compare_le_64 (void)
 void
 compare_gt_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a = 100;
 
   VERIFY (a > si);
@@ -323,6 +334,7 @@ compare_gt_64 (void)
 void
 compare_ge_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a;
 
   a = si;   VERIFY (a >= si);   VERIFY (si <= a);
@@ -361,6 +373,7 @@ compare_ge_64 (void)
 void
 compare_eq_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a;
 
   a = si;   VERIFY (a == si);   VERIFY (si == a);
@@ -377,6 +390,7 @@ compare_eq_128 (void)
 void
 compare_ne_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a = 100;
 
   VERIFY (a != si);   VERIFY (si != a);
@@ -393,6 +407,7 @@ compare_ne_128 (void)
 void
 compare_lt_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a = -100;
 
   VERIFY (a < si);
@@ -420,6 +435,7 @@ compare_lt_128 (void)
 void
 compare_le_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a;
 
   a = si;   VERIFY (a <= si);   VERIFY (si <= a);
@@ -458,6 +474,7 @@ compare_le_128 (void)
 void
 compare_gt_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a = 100;
 
   VERIFY (a > si);
@@ -485,6 +502,7 @@ compare_gt_128 (void)
 void
 compare_ge_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a;
 
   a = si;   VERIFY (a >= si);   VERIFY (si <= a);
index c216faa809543477b6226c623daf8fa68e702c6c..617769247d4f41c8dac2149d2091fa63b592d2f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -41,6 +41,7 @@ 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);
@@ -57,6 +58,7 @@ compound_assignment_add_32 (void)
 void
 compound_assignment_subtract_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b.operator-=(d32);  VERIFY (b == 995);
@@ -73,6 +75,7 @@ compound_assignment_subtract_32 (void)
 void
 compound_assignment_multiply_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b.operator*=(d32);  VERIFY (b == 5000);
@@ -89,6 +92,7 @@ compound_assignment_multiply_32 (void)
 void
 compound_assignment_divide_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b.operator/=(d32);  VERIFY (b == 200);
@@ -105,6 +109,7 @@ compound_assignment_divide_32 (void)
 void
 compound_assignment_add_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b.operator+=(d32);  VERIFY (b == 1005);
@@ -121,6 +126,7 @@ compound_assignment_add_64 (void)
 void
 compound_assignment_subtract_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b.operator-=(d32);  VERIFY (b == 995);
@@ -137,6 +143,7 @@ compound_assignment_subtract_64 (void)
 void
 compound_assignment_multiply_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b.operator*=(d32);  VERIFY (b == 5000);
@@ -153,6 +160,7 @@ compound_assignment_multiply_64 (void)
 void
 compound_assignment_divide_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b.operator/=(d32);  VERIFY (b == 200);
@@ -169,6 +177,7 @@ compound_assignment_divide_64 (void)
 void
 compound_assignment_add_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b.operator+=(d32);  VERIFY (b == 1005);
@@ -185,6 +194,7 @@ compound_assignment_add_128 (void)
 void
 compound_assignment_subtract_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b.operator-=(d32);  VERIFY (b == 995);
@@ -201,6 +211,7 @@ compound_assignment_subtract_128 (void)
 void
 compound_assignment_multiply_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b.operator*=(d32);  VERIFY (b == 5000);
@@ -217,6 +228,7 @@ compound_assignment_multiply_128 (void)
 void
 compound_assignment_divide_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b.operator/=(d32);  VERIFY (b == 200);
index 2a1f4a7218cc4af17cd02ec076a93b9734f90506..9afdbf45652019e987e560808596e136fa19fdcd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -39,6 +39,7 @@ 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);
@@ -55,6 +56,7 @@ compound_assignment_add_32 (void)
 void
 compound_assignment_subtract_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b -= d32;  VERIFY (b == 995);
@@ -71,6 +73,7 @@ compound_assignment_subtract_32 (void)
 void
 compound_assignment_multiply_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b *= d32;  VERIFY (b == 5000);
@@ -87,6 +90,7 @@ compound_assignment_multiply_32 (void)
 void
 compound_assignment_divide_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a (1000), b;
 
   b = a; b /= d32;  VERIFY (b == 200);
@@ -103,6 +107,7 @@ compound_assignment_divide_32 (void)
 void
 compound_assignment_add_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b += d32;  VERIFY (b == 1005);
@@ -119,6 +124,7 @@ compound_assignment_add_64 (void)
 void
 compound_assignment_subtract_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b -= d32;  VERIFY (b == 995);
@@ -135,6 +141,7 @@ compound_assignment_subtract_64 (void)
 void
 compound_assignment_multiply_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b *= d32;  VERIFY (b == 5000);
@@ -151,6 +158,7 @@ compound_assignment_multiply_64 (void)
 void
 compound_assignment_divide_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a (1000), b;
 
   b = a; b /= d32;  VERIFY (b == 200);
@@ -167,6 +175,7 @@ compound_assignment_divide_64 (void)
 void
 compound_assignment_add_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b += d32;  VERIFY (b == 1005);
@@ -183,6 +192,7 @@ compound_assignment_add_128 (void)
 void
 compound_assignment_subtract_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b -= d32;  VERIFY (b == 995);
@@ -199,6 +209,7 @@ compound_assignment_subtract_128 (void)
 void
 compound_assignment_multiply_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b *= d32;  VERIFY (b == 5000);
@@ -215,6 +226,7 @@ compound_assignment_multiply_128 (void)
 void
 compound_assignment_divide_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a (1000), b;
 
   b = a; b /= d32;  VERIFY (b == 200);
index c1824a827ccb5e4ee1da02eff795ea0556595157..48fd6d48c5f5ad98f200af4ed6f4803c235792ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -29,6 +29,7 @@ using namespace std::decimal;
 void
 conversion_from_float_32 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal32 d32(123);
   decimal64 d64(234);
   decimal128 d128(345);
@@ -51,6 +52,7 @@ conversion_from_float_32 ()
 void
 conversion_from_float_64 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal32 d32(123);
   decimal64 d64(234);
   decimal128 d128(345);
@@ -73,6 +75,7 @@ conversion_from_float_64 ()
 void
 conversion_from_float_128 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal32 d32(123);
   decimal64 d64(234);
   decimal128 d128(345);
index 78d5eb76a7932d7bb44a7cc04bb888b569050b2a..23da3c157277abbb4605e15c687941cbbe5448f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -29,6 +29,7 @@ using namespace std::decimal;
 void
 conversion_from_integral_p32 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal32 d;
   decimal32 from_si (1);
   decimal32 from_ui (2U);
@@ -61,6 +62,7 @@ conversion_from_integral_p32 ()
 void
 conversion_from_integral_m32 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal32 d;
   decimal32 from_si (-1);
   decimal32 from_sl (-2L);
@@ -81,6 +83,7 @@ conversion_from_integral_m32 ()
 void
 conversion_from_integral_p64 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal64 d;
   decimal64 from_si (1);
   decimal64 from_ui (2U);
@@ -113,6 +116,7 @@ conversion_from_integral_p64 ()
 void
 conversion_from_integral_m64 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal64 d;
   decimal64 from_si (-1);
   decimal64 from_sl (-2L);
@@ -133,6 +137,7 @@ conversion_from_integral_m64 ()
 void
 conversion_from_integral_p128 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal128 d;
   decimal128 from_si (1);
   decimal128 from_ui (2U);
@@ -164,6 +169,7 @@ conversion_from_integral_p128 ()
 void
 conversion_from_integral_m128 ()
 {
+  bool test __attribute__((unused)) = true;
   decimal128 d;
   decimal128 from_si (-1);
   decimal128 from_sl (-2L);
index bac0c820ee6fafcc296f9ed90e85c022e06afb20..fec39e68b93082543190e5534dab2c82c9d530ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -27,7 +27,8 @@ using namespace std::decimal;
 void
 conversion_to_generic_float_32 ()
 {
-  std::decimal::decimal32 d32(123);
+  bool test __attribute__((unused)) = true;
+  decimal32 d32(123);
   float f;
   double d;
   long double ld;
@@ -51,7 +52,8 @@ conversion_to_generic_float_32 ()
 void
 conversion_to_generic_float_64 ()
 {
-  std::decimal::decimal64 d64(234);
+  bool test __attribute__((unused)) = true;
+  decimal64 d64(234);
   float f;
   double d;
   long double ld;
@@ -75,7 +77,8 @@ conversion_to_generic_float_64 ()
 void
 conversion_to_generic_float_128 ()
 {
-  std::decimal::decimal128 d128(345);
+  bool test __attribute__((unused)) = true;
+  decimal128 d128(345);
   float f;
   double d;
   long double ld;
index 9322c1bc78fa80f1a842c966cddf8696c40857f7..41ff2f5d409dfc6b154cbf734ad4b0113f7d4641 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -23,7 +23,6 @@
 
 #include <decimal/decimal>
 #include <climits>
-#include <cstdio>
 #include <testsuite_hooks.h>
 
 // Use extension to replace implicit long long conversion with function call.
@@ -36,6 +35,7 @@ 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;
 
@@ -51,6 +51,7 @@ 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;
 
@@ -66,6 +67,7 @@ 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;
 
index 84e04ade691e0399758b828e887508e372beb6e9..6164a020b41e22c7b9b429b36dbecbc923f11b9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -32,28 +32,31 @@ using namespace std::decimal;
 void
 ctor_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a;
   float b __attribute__((mode(SD))) = 0.e-101DF;
 
-  VERIFY (memcmp (&a, &b, 4) == 0);
+  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 (memcmp (&a, &b, 8) == 0);
+  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 (memcmp (&a, &b, 16) == 0);
+  VERIFY (std::memcmp (&a, &b, 16) == 0);
 }
 
 int
index f2d1178a6f1a527037470ef5948ffb314697f229..31e4579e20fc201a93a3f6667ebe5e0fd2a81d37 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -34,8 +34,9 @@ using namespace std::decimal;
 void
 incdec32 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal32 a(11), b, c;
+  decimal32 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
@@ -81,8 +82,9 @@ incdec32 (void)
 void
 incdec64 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal64 a(11), b, c;
+  decimal64 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
@@ -128,8 +130,9 @@ incdec64 (void)
 void
 incdec128 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal128 a(11), b, c;
+  decimal128 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
index 45211b1de216420e9e1aaa533a7354f4bb8621f8..370edf49581c57ad5e247665a37db1a7ff69a94f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -32,8 +32,9 @@ using namespace std::decimal;
 void
 incdec32 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal32 a(11), b, c;
+  decimal32 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
@@ -79,8 +80,9 @@ incdec32 (void)
 void
 incdec64 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal64 a(11), b, c;
+  decimal64 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
@@ -126,8 +128,9 @@ incdec64 (void)
 void
 incdec128 (void)
 {
+  bool test __attribute__((unused)) = true;
   int ival;
-  std::decimal::decimal128 a(11), b, c;
+  decimal128 a(11), b, c;
 
   // Verify that we get the expected value of b after assignment.
   b = a;
index be4fa4632addd5e68ea9b9d7e366f5ef5454943a..4d1bee5749a1bb6f731469b16e3ba69539a8fc81 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -32,8 +32,8 @@
   i = ESIGN EXP;                                                       \
   a = PASTE(make_decimal,32) (sll, i);                                 \
   b = PASTE(make_decimal,32) (PASTE(COEFF,LL), ESIGN EXP);     \
-  VERIFY ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) == 0)       \
-          && (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) == 0));
+  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);      \
   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 ((__builtin_memcmp ((void *)&x, (void *)&a, SIZE) == 0)       \
-          && (__builtin_memcmp ((void *)&x, (void *)&b,SIZE) == 0)     \
-          && (__builtin_memcmp ((void *)&x, (void *)&c,SIZE) == 0)     \
-          && (__builtin_memcmp ((void *)&x, (void *)&d,SIZE) == 0));
+  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;
@@ -78,6 +79,7 @@ make_decimal_32 (void)
 void
 make_decimal_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a, b, c, d;
   float x __attribute__((mode(DD)));
   int i;
@@ -102,6 +104,7 @@ make_decimal_64 (void)
 void
 make_decimal_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a, b, c, d;
   float x __attribute__((mode(TD)));
   int i;
index afdc0382cd1928160bcc6c6895f382a6e5cd0df1..dfd90d69df4faebedd75f0a6a25d2a15c1e4f2f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -25,7 +25,6 @@
 // floating-point type to a generic floating-point type.
 
 #include <decimal/decimal>
-#include <testsuite_hooks.h>
 
 using namespace std::decimal;
 
index 5ff9a71a7ea78b18e8d4e12d66f1f57ed6f5ef41..d89e631ef1e010dc8a9352a9dfb73b6153a89653 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -25,7 +25,6 @@
 // generic floating-point type.
 
 #include <decimal/decimal>
-#include <testsuite_hooks.h>
 
 using namespace std::decimal;
 
diff --git a/libstdc++-v3/testsuite/decimal/pr54036-1.cc b/libstdc++-v3/testsuite/decimal/pr54036-1.cc
new file mode 100644 (file)
index 0000000..4e08084
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2012 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/libstdc++-v3/testsuite/decimal/pr54036-2.cc b/libstdc++-v3/testsuite/decimal/pr54036-2.cc
new file mode 100644 (file)
index 0000000..f20ad77
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2012 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/libstdc++-v3/testsuite/decimal/pr54036-3.cc b/libstdc++-v3/testsuite/decimal/pr54036-3.cc
new file mode 100644 (file)
index 0000000..662c945
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2012 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;
+}
index d32b98d0d518316e5a24cc00cb8ae11841bb1649..b75d8ec2ba2c65055031731521f011e9cbe4c655 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009-2012 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
@@ -31,6 +31,7 @@ decimal128 a128 (5001), b128 (-5001);
 void
 unary_plus_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a;
 
   a = +a32; VERIFY (a == a32);
@@ -40,6 +41,7 @@ unary_plus_32 (void)
 void
 unary_minus_32 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal32 a;
 
   a = -a32; VERIFY (a == b32);
@@ -49,6 +51,7 @@ unary_minus_32 (void)
 void
 unary_plus_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a;
 
   a = +a64; VERIFY (a == a64);
@@ -58,6 +61,7 @@ unary_plus_64 (void)
 void
 unary_minus_64 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal64 a;
 
   a = -a64; VERIFY (a == b64);
@@ -67,6 +71,7 @@ unary_minus_64 (void)
 void
 unary_plus_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a;
 
   a = +a128; VERIFY (a == a128);
@@ -76,6 +81,7 @@ unary_plus_128 (void)
 void
 unary_minus_128 (void)
 {
+  bool test __attribute__((unused)) = true;
   decimal128 a;
 
   a = -a128; VERIFY (a == b128);