From b8c926fffb2acc99b1410c2e565b07bdc83952b2 Mon Sep 17 00:00:00 2001 From: manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 8 Dec 2006 18:14:21 +0000 Subject: [PATCH] 2006-12-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * lib/target-supports.exp (check_effective_target_large_long_double): New. * gcc.dg/Wconversion-real.c : Use it. * gcc.dg/Wconversion-integer.c : Fix for targets where char is unsigned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119662 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.dg/Wconversion-integer.c | 2 +- gcc/testsuite/gcc.dg/Wconversion-real.c | 10 +++++----- gcc/testsuite/lib/target-supports.exp | 10 ++++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c86dcd2704d0..fe8632a881d0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2006-12-08 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + * lib/target-supports.exp + (check_effective_target_large_long_double): New. + * gcc.dg/Wconversion-real.c : Use it. + * gcc.dg/Wconversion-integer.c : Fix for targets where char is + unsigned. + 2006-12-08 Mark Shinwell <shinwell@codesourcery.com> * gcc.c-torture/execute/mode-dependent-address.c: New test. diff --git a/gcc/testsuite/gcc.dg/Wconversion-integer.c b/gcc/testsuite/gcc.dg/Wconversion-integer.c index bab8062b777f..515aba30dbf4 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-integer.c +++ b/gcc/testsuite/gcc.dg/Wconversion-integer.c @@ -2,7 +2,7 @@ These tests come from gcc/testsuite/gcc.dg/overflow-warn-2.c */ /* { dg-do compile } */ -/* { dg-options "-std=c99 -Wconversion" } */ +/* { dg-options "-std=c99 -fsigned-char -Wconversion" } */ #include <limits.h> diff --git a/gcc/testsuite/gcc.dg/Wconversion-real.c b/gcc/testsuite/gcc.dg/Wconversion-real.c index 53ac9a7e1b65..877fcea391f6 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-real.c +++ b/gcc/testsuite/gcc.dg/Wconversion-real.c @@ -20,15 +20,15 @@ void h (void) ffloat (3.1); /* { dg-warning "conversion" } */ vfloat = 3.1; /* { dg-warning "conversion" } */ ffloat (3.1L); /* { dg-warning "conversion" } */ - vfloat = 3.1L; /* { dg-warning "conversion" } */ - fdouble (3.1L); /* { dg-warning "conversion" } */ - vdouble = 3.1L; /* { dg-warning "conversion" } */ + vfloat = 3.1L; /* { dg-warning "conversion" } */ + fdouble (3.1L); /* { dg-warning "conversion" "" { target large_long_double } } */ + vdouble = 3.1L; /* { dg-warning "conversion" "" { target large_long_double } } */ ffloat (vdouble); /* { dg-warning "conversion" } */ vfloat = vdouble; /* { dg-warning "conversion" } */ ffloat (vlongdouble); /* { dg-warning "conversion" } */ vfloat = vlongdouble; /* { dg-warning "conversion" } */ - fdouble (vlongdouble); /* { dg-warning "conversion" } */ - vdouble = vlongdouble; /* { dg-warning "conversion" } */ + fdouble (vlongdouble); /* { dg-warning "conversion" "" { target large_long_double } } */ + vdouble = vlongdouble; /* { dg-warning "conversion" "" { target large_long_double } } */ ffloat ((float) 3.1); diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4dd0b8e6e36e..221d17d474da 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1118,6 +1118,16 @@ proc check_effective_target_lp64 { } { }] } +# Return 1 if the target supports long double larger than double, +# 0 otherwise. + +proc check_effective_target_large_long_double { } { + return [check_no_compiler_messages large_long_double object { + int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; + }] +} + + # Return 1 if the target supports compiling decimal floating point, # 0 otherwise. -- GitLab