diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-13 10:01:52 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-13 10:01:52 +0000 |
commit | 2725970784399fb8efb1c946472340c2de074f45 (patch) | |
tree | c369a65444f35bfe20b1e10fe92aa6089f0b2b5e /gcc/testsuite/gcc.dg/Wconversion-integer.c | |
parent | dddf503682e4d834e9a8cbbd280a0e60586b5b98 (diff) | |
download | gcc-2725970784399fb8efb1c946472340c2de074f45.tar.gz |
2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 35635
* c-common.c (conversion_warning): Use a switch. Ignore boolean
expressions except for conversions to signed:1 bitfields. Handle
COND_EXPR with constant operands.
testsuite/
* gcc.dg/pr35635.c: New.
* gcc.dg/Wconversion-integer.c: Update.
* gcc.dg/Wconversion-integer-no-sign.c: Update.
* gcc.dg/Wsign-conversion.c: Update.
* g++.dg/warn/pr35635.C: New.
* g++.dg/warn/Wconversion-integer.C: Update.
* g++.dg/warn/Wsign-conversion.C: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139049 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wconversion-integer.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wconversion-integer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/testsuite/gcc.dg/Wconversion-integer.c b/gcc/testsuite/gcc.dg/Wconversion-integer.c index 9e3b948251c..b2101076f93 100644 --- a/gcc/testsuite/gcc.dg/Wconversion-integer.c +++ b/gcc/testsuite/gcc.dg/Wconversion-integer.c @@ -44,15 +44,15 @@ void h (int x) /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 43 } */ uc = x ? SCHAR_MIN : 1U; /* { dg-warning "conversion" } */ /* { dg-warning "negative integer implicitly converted to unsigned type" "" { target *-*-* } 45 } */ - uc = x ? 1 : -1; /* { dg-warning "conversion" } */ - uc = x ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */ + uc = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ + uc = x ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = x ? 1U : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = x ? INT_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = ui ? SCHAR_MIN : 1U; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = 1U * -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ ui = ui + INT_MIN; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ - ui = x ? 1 : -1; /* { dg-warning "conversion" } */ - ui = ui ? SCHAR_MIN : 1; /* { dg-warning "conversion" } */ + ui = x ? 1 : -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ + ui = ui ? SCHAR_MIN : 1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ fuc (-1); /* { dg-warning "negative integer implicitly converted to unsigned type" } */ uc = -1; /* { dg-warning "negative integer implicitly converted to unsigned type" } */ |