diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64ffc51820d..8aa7cb80145 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +1999-05-03 Kaveh R. Ghazi + + * gcc.dg/compare1.c: New test. + 1999-05-02 Joseph S. Myers * gcc.dg/cast-qual-1.c, gcc.dg/return-type-1.c, gcc.dg/unused-1.c: diff --git a/gcc/testsuite/gcc.dg/compare1.c b/gcc/testsuite/gcc.dg/compare1.c new file mode 100644 index 00000000000..bba5f1d1dce --- /dev/null +++ b/gcc/testsuite/gcc.dg/compare1.c @@ -0,0 +1,26 @@ +/* Test for a bogus warning on comparison between signed and unsigned. + This was inspired by code in gcc. */ + +/* { dg-do compile } */ +/* { dg-options "-Wsign-compare" } */ + +int target_flags = 1; + +enum machine_mode +{ + VOIDmode , PQImode , QImode , PHImode , HImode , + PSImode , SImode , PDImode , DImode , TImode , OImode , QFmode , + HFmode , TQFmode , SFmode , DFmode , XFmode , TFmode , QCmode , + HCmode , SCmode , DCmode , XCmode , TCmode , CQImode , CHImode , + CSImode , CDImode , CTImode , COImode , BLKmode , CCmode , CCXmode, + CC_NOOVmode, CCX_NOOVmode, CCFPmode, CCFPEmode , MAX_MACHINE_MODE +}; + +#define Pmode ( target_flags ? DImode : SImode ) + +int main() +{ + enum machine_mode mode = DImode; + + return (mode == Pmode); /* dg-bogus "warning:" "comparison between signed and unsigned" } */ +}