Hi, On Wed, Oct 10 2018, Christophe Lyon wrote: > On 10/10/2018 13:17, Martin Jambor wrote: >> Hi, >> >> On Wed, Sep 26 2018, Joseph Myers wrote: >>> On Wed, 26 Sep 2018, Martin Jambor wrote: >>> >>>> I see, I guess the easiest is to skip the test on targets that do not >>>> really have long double, although if someone thinks that is too >>>> restrictive, I can also split the test again and move long double bits >>>> to a separate test. >>> You should be able to use >>> >>> { dg-warning "warning regex" "test name" { target { large_long_double } } } >>> >>> to make the expectation of a warning conditional without making the whole >>> test conditional. >> I hoped that Christophe would try this out because I do not have an easy >> access to a problematic architecture, but I can at least confirm that >> the following still passes on x86_64-linux (and should also pass on >> archs without long double, if I understood Joseph well). > > I did: https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01713.html > Sorry if I wasn't explicit enough
Oh, sorry, I somehow completely missed that. Thanks for testing then. >> @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld) >> void tst_cplx_size (complex double *pcd, complex long double *pcld) >> { >> *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } >> */ >> - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } >> */ >> + *pcld = cabs (*pcld); /* { /* { dg-warning "may cause truncation of >> value" "cabs trunc" { target { > > OK for me, except that you have an extra '/*' in the line above. > Silly me, the fixed patch is below. OK for trunk? Martin 2018-10-10 Martin Jambor <mjam...@suse.cz> testsuite/ * gcc.dg/warn-abs-1.c: Guard tests assuming size of long double is greater that the size of double by target large_long double. --- gcc/testsuite/gcc.dg/warn-abs-1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/warn-abs-1.c b/gcc/testsuite/gcc.dg/warn-abs-1.c index 1c487270042..c016ff620c4 100644 --- a/gcc/testsuite/gcc.dg/warn-abs-1.c +++ b/gcc/testsuite/gcc.dg/warn-abs-1.c @@ -43,7 +43,7 @@ void 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 (*pld); /* { dg-warning "may cause truncation of value" "fabs trunc" { target { large_long_double } } } */ *pld = fabs ((double) *pld); } @@ -57,7 +57,7 @@ void tst_notcomplex (int *pi, long *pl, long double *pld) void tst_cplx_size (complex double *pcd, complex long double *pcld) { *pcd = cabsf (*pcd); /* { dg-warning "may cause truncation of value" } */ - *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" } */ + *pcld = cabs (*pcld); /* { dg-warning "may cause truncation of value" "cabs trunc" { target { large_long_double } } } */ *pcld = cabs ((complex double) *pcld); } -- 2.19.0