compare8.c: New test case.

* gcc.dg/compare8.c: New test case.

Co-Authored-By: Roger Sayle <roger@eyesopen.com>

From-SVN: r79891
This commit is contained in:
Joseph Myers 2004-03-24 00:19:06 +00:00 committed by Roger Sayle
parent cba4497d92
commit 5a93e8dea1
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-03-23 Joseph S. Myers <jsm@polyomino.org.uk>
Roger Sayle <roger@eyesopen.com>
* gcc.dg/compare8.c: New test case.
2004-03-23 Ziemowit Laski <zlaski@apple.com>
* g++.dg/ext/altivec-7.C: New test.

View File

@ -0,0 +1,15 @@
/* { dg-do compile } */
/* { dg-options "-Wsign-compare" } */
int
f(unsigned short a1, unsigned short a2, unsigned int b)
{
return ((a1+a2)|5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
}
int
g(unsigned short a1, unsigned short a2, unsigned int b)
{
return ((a1+a2)&5) > b ? 2 : 3; /* { dg-bogus "signed and unsigned" } */
}