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
* 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 <borut.razem AT siol.net>
#include <inttypes.h>
#else
#include <stdint.h>
+#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;
ASSERT (! ( 0 != sb));
ASSERT ( ( 1 != sb));
- ASSERT ( (-1 < sb));
+ ASSERT ( (-1 < INT_CAST sb));
ASSERT (! ( 0 < sb));
ASSERT ( ( 0 <= sb));
ASSERT (! ( 0 > sb));
ASSERT ( ( 1 > sb));
- ASSERT (! (-1 >= sb));
+ ASSERT (! (-1 >= INT_CAST sb));
ASSERT ( ( 0 >= sb));
ASSERT (! ( 0 != ub));
ASSERT ( ( 1 != ub));
- ASSERT ( (-1 < ub));
+ ASSERT ( (-1 < INT_CAST ub));
ASSERT (! ( 0 < ub));
ASSERT ( ( 0 <= ub));
ASSERT (! ( 0 > ub));
ASSERT ( ( 1 > ub));
- ASSERT (! (-1 >= ub));
+ ASSERT (! (-1 >= INT_CAST ub));
ASSERT ( ( 0 >= ub));
}