From: borutr Date: Thu, 6 Jul 2006 20:24:43 +0000 (+0000) Subject: * support/regression/tests/constantRange.c: X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=2251304b76c8875d1e8daeb638922b77feb6562c;p=fw%2Fsdcc * support/regression/tests/constantRange.c: fixed bug [ 1518317 ] regression test constantRange fails on alpha host git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4272 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index cbb59d68..58ba8339 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * support/regression/tests/bitfields.c: fixed bug [ 1518322 ] regression test bitfields fails on ppc hosts + * support/regression/tests/constantRange.c: + fixed bug [ 1518317 ] regression test constantRange fails on alpha host 2006-07-04 Borut Razem diff --git a/support/regression/tests/constantRange.c b/support/regression/tests/constantRange.c index 5c1feeef..a4000ace 100644 --- a/support/regression/tests/constantRange.c +++ b/support/regression/tests/constantRange.c @@ -8,6 +8,13 @@ #include #else #include +#endif + +#if defined (__GNUC__) && defined (__alpha__) && (__GNUC__ < 3) +/* bool should be casted to int in order to pass the test. Is this a gcc bug? */ +#define INT_CAST (int) +#else +#define INT_CAST #endif int8_t s8; @@ -125,7 +132,7 @@ testFoo1(void) ASSERT (! ( 0 != sb)); ASSERT ( ( 1 != sb)); - ASSERT ( (-1 < sb)); + ASSERT ( (-1 < INT_CAST sb)); ASSERT (! ( 0 < sb)); ASSERT ( ( 0 <= sb)); @@ -134,7 +141,7 @@ testFoo1(void) ASSERT (! ( 0 > sb)); ASSERT ( ( 1 > sb)); - ASSERT (! (-1 >= sb)); + ASSERT (! (-1 >= INT_CAST sb)); ASSERT ( ( 0 >= sb)); @@ -146,7 +153,7 @@ testFoo1(void) ASSERT (! ( 0 != ub)); ASSERT ( ( 1 != ub)); - ASSERT ( (-1 < ub)); + ASSERT ( (-1 < INT_CAST ub)); ASSERT (! ( 0 < ub)); ASSERT ( ( 0 <= ub)); @@ -155,7 +162,7 @@ testFoo1(void) ASSERT (! ( 0 > ub)); ASSERT ( ( 1 > ub)); - ASSERT (! (-1 >= ub)); + ASSERT (! (-1 >= INT_CAST ub)); ASSERT ( ( 0 >= ub)); }