From 37a16493e4e8f312da299f678b20b45c1815b537 Mon Sep 17 00:00:00 2001 From: James Greenhalgh Date: Thu, 10 Nov 2016 16:53:58 +0000 Subject: [PATCH] [Patch testsuite] Check range of exponent for tests added in r241817 gcc/ChangeLog 2016-11-10 James Greenhalgh * gcc.dg/torture/fp-int-convert.h (M_OK2): New, use it in WVAL0S tests added in r241817. From-SVN: r242041 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/fp-int-convert.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 03dcd5b6515..50281572ec5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-10 James Greenhalgh + + * gcc.dg/torture/fp-int-convert.h (M_OK2): New, use it in + WVAL0S tests added in r241817. + 2016-11-10 Jakub Jelinek * gfortran.dg/gomp/pr77516.f90: Add dg-warning. diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h index bbe96668d0b..2b904b6595c 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h @@ -53,13 +53,14 @@ do { \ TEST_I_F_VAL (U, F, HVAL1U (P, U), P_OK (P, U)); \ TEST_I_F_VAL (U, F, HVAL1U (P, U) + 1, P_OK (P, U)); \ TEST_I_F_VAL (U, F, HVAL1U (P, U) - 1, P_OK (P, U)); \ - TEST_I_F_VAL (I, F, WVAL0S (I), 1); \ - TEST_I_F_VAL (I, F, -WVAL0S (I), 1); \ + TEST_I_F_VAL (I, F, WVAL0S (I), M_OK2 (M, U)); \ + TEST_I_F_VAL (I, F, -WVAL0S (I), M_OK2 (M, U)); \ } while (0) #define P_OK(P, T) ((P) >= sizeof(T) * CHAR_BIT) #define P_OK1(P, T) ((P) >= sizeof(T) * CHAR_BIT - 1) #define M_OK1(M, T) ((M) > sizeof(T) * CHAR_BIT - 1) +#define M_OK2(M, T) ((M) > sizeof(T) * CHAR_BIT / 2 - 1) #define HVAL0U(P, U) (U)(P_OK (P, U) \ ? (U)1 \ : (((U)1 << (sizeof(U) * CHAR_BIT - 1)) \ -- 2.30.2