* gcc/testsuite/gcc.dg/dfp/dfp-dbg.h: Define EXTERN.
* gcc/testsuite/gcc.dg/dfp/signbit-2.c: Use it.
* gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h: Change two
arguments to unsigned int.
* gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c: Don't include float.h.
* gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c: Include dfp-dbg.h.
* gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c: Ditto
* gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c: Ditto.
* gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c: Ditto.
* gcc/testsuite/gcc.dg/dfp/pr39986.c: Ditto.
* gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c: Ditto.
* gcc/testsuite/gcc.dg/dfp/pr31385.c: Use mode in typedef, not C type.
* gcc/testsuite/gcc.dg/dfp/pr35620.c: Define typedef for C++.
* gcc/testsuite/gcc.dg/dfp/convert-int.c: Define BOOL for C++.
* gcc/testsuite/gcc.dg/dfp/convert-int-fold.c: Ditto.
From-SVN: r151821
+2009-09-17 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc/testsuite/gcc.dg/dfp/dfp-dbg.h: Define EXTERN.
+ * gcc/testsuite/gcc.dg/dfp/signbit-2.c: Use it.
+ * gcc/testsuite/gcc.dg/dfp/func-vararg-alternate.h: Change two
+ arguments to unsigned int.
+ * gcc/testsuite/gcc.dg/dfp/convert-bfp-10.c: Don't include float.h.
+ * gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c: Include dfp-dbg.h.
+ * gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c: Ditto
+ * gcc/testsuite/gcc.dg/dfp/convert-int-max-fold.c: Ditto.
+ * gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c: Ditto.
+ * gcc/testsuite/gcc.dg/dfp/pr39986.c: Ditto.
+ * gcc/testsuite/gcc.dg/dfp/usual-arith-conv-const.c: Ditto.
+ * gcc/testsuite/gcc.dg/dfp/pr31385.c: Use mode in typedef, not C type.
+ * gcc/testsuite/gcc.dg/dfp/pr35620.c: Define typedef for C++.
+ * gcc/testsuite/gcc.dg/dfp/convert-int.c: Define BOOL for C++.
+ * gcc/testsuite/gcc.dg/dfp/convert-int-fold.c: Ditto.
+
2009-09-17 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/dwarf2/struct-loc1.c: New test.
/* This test assumes IEEE float and double. */
-#define __STDC_WANT_DEC_FP__
-#include <float.h>
-
#include "convert.h"
volatile _Decimal32 sd;
decimal floating types and generic floating types.
C99 6.3.1.5(4) Conversions, arithmetic operands, real floating types. */
+#include "dfp-dbg.h"
+
_Decimal32 d32;
_Decimal64 d64;
_Decimal128 d128;
decimal floating types and generic floating types.
C99 6.3.1.5(3) New. */
+#include "dfp-dbg.h"
+
extern void link_error ();
int
#include "dfp-dbg.h"
+#ifdef __cplusplus
+#define BOOL bool
+#else
#define BOOL _Bool
+#endif
extern void link_error (void);
64-bit long long (there's a check for that below). This version tests
conversions during compilation. */
+#include "dfp-dbg.h"
+
extern void link_error (void);
void
#include "dfp-dbg.h"
+#ifdef __cplusplus
+#define BOOL bool
+#else
#define BOOL _Bool
+#endif
_Decimal32 d32;
_Decimal64 d64;
+#define EXTERN extern
+
int failures;
#ifdef DBG
};
void
-compare (double r, double s, int *p, int *q, int n, int line)
+compare (double r, double s, unsigned int *p, unsigned int *q, int n, int line)
{
int i;
/* C99 6.5.5: Multiplicative operators.
C99 6.5.6: Additive operators. */
+#include "dfp-dbg.h"
+
extern void link_error (void);
int
/* { dg-do compile } */
/* { dg-options "-O2" } */
-typedef _Decimal32 fp_t;
+typedef float fp_t __attribute__((mode(SD)));
extern fp_t g(fp_t);
/* { dg-do compile } */
/* { dg-options "-O2" } */
+#ifdef __cplusplus
+typedef float _Decimal32 __attribute__((mode(SD)));
+#endif
+
extern void foo (_Decimal32);
_Decimal32 *p;
/* { dg-do compile } */
+#include "dfp-dbg.h"
+
/* Check that the compiler generates the correct decimal float constants. */
_Decimal32 a = 100.223df;
volatile double d = -7.8;
volatile long double ld = 3.4L;
-extern int signbitf (float);
-extern int signbit (double);
-extern int signbitl (long double);
-extern int signbitd32 (_Decimal32);
-extern int signbitd64 (_Decimal64);
-extern int signbitd128 (_Decimal128);
+EXTERN int signbitf (float);
+EXTERN int signbit (double);
+EXTERN int signbitl (long double);
+EXTERN int signbitd32 (_Decimal32);
+EXTERN int signbitd64 (_Decimal64);
+EXTERN int signbitd128 (_Decimal128);
int
main ()
/* Test various conversions involving decimal floating types. */
+#include "dfp-dbg.h"
+
/* Assertion that constant C is of type T. */
#define ASSERT_CONST_TYPE(C, T) \
do { \