From e8753bb88e273b5fd1adba241edb78513aab6c39 Mon Sep 17 00:00:00 2001 From: Martin Jambor Date: Tue, 25 Sep 2018 18:28:40 +0200 Subject: [PATCH] [PR 87339] Fix failure of gcc.dg/warn-abs-1.c on some targets 2018-09-25 Martin Jambor PR testsuite/87339 * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and float125 target. * gcc.target/i386/warn-abs-3.c: New test. From-SVN: r264579 --- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/warn-abs-1.c | 6 ++---- gcc/testsuite/gcc.target/i386/warn-abs-3.c | 12 ++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/warn-abs-3.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 056597d153f..24bf238e0f6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-09-25 Martin Jambor + + PR testsuite/87339 + * gcc.dg/warn-abs-1.c: Do not test _Float128. Remove dg-skip-if and + float125 target. + * gcc.target/i386/warn-abs-3.c: New test. + 2018-09-25 Paolo Carlini PR c++/81246 diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c index 129a3af8ac6..1c487270042 100644 --- a/gcc/testsuite/gcc.dg/warn-abs-1.c +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c @@ -1,5 +1,4 @@ -/* { dg-do compile { target float128 } } */ -/* { dg-skip-if "incomplete long double support" { { newlib } && large_long_double } } */ +/* { dg-do compile } */ /* { dg-options "-Wabsolute-value" } */ #include @@ -41,12 +40,11 @@ tst_notfloat (int *pi, long *pl, complex double *pc) } void -tst_float_size (double *pd, long double *pld, _Float128 *pf128) +tst_float_size (double *pd, long double *pld) { *pd = fabsf (*pd); /* { dg-warning "may cause truncation of value" } */ *pld = fabs (*pld); /* { dg-warning "may cause truncation of value" } */ *pld = fabs ((double) *pld); - *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */ } void tst_notcomplex (int *pi, long *pl, long double *pld) diff --git a/gcc/testsuite/gcc.target/i386/warn-abs-3.c b/gcc/testsuite/gcc.target/i386/warn-abs-3.c new file mode 100644 index 00000000000..21feaff7d8a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/warn-abs-3.c @@ -0,0 +1,12 @@ +/* { dg-do compile { target float128 } } */ +/* { dg-options "-Wabsolute-value" } */ + +#include +#include +#include + +void +tst_float128_size (_Float128 *pf128) +{ + *pf128 = fabsl (*pf128); /* { dg-warning "may cause truncation of value" } */ +} -- 2.30.2