ack/tests/plat/core/intcmp_e.c

66 lines
2 KiB
C
Raw Normal View History

2016-11-14 21:01:25 +00:00
#include "test.h"
/* Constants in globals to defeat constant folding. */
int one = 1;
int zero = 0;
/* Bypasses the CRT, so there's no stdio. */
2016-11-14 21:01:25 +00:00
void _m_a_i_n(void)
{
ASSERT(zero == zero);
ASSERT(one != zero);
ASSERT(zero < one);
ASSERT(zero <= one);
ASSERT(zero <= zero);
ASSERT(one > zero);
ASSERT(one >= zero);
ASSERT(one >= one);
ASSERT(zero == 0);
ASSERT(one != 0);
ASSERT(zero < 1);
ASSERT(zero <= 1);
ASSERT(zero <= 0);
ASSERT(one > 0);
ASSERT(one >= 0);
ASSERT(one >= 1);
ASSERT(0 == zero);
ASSERT(1 != zero);
ASSERT(0 < one);
ASSERT(0 <= one);
ASSERT(0 <= zero);
ASSERT(1 > zero);
ASSERT(1 >= zero);
ASSERT(1 >= one);
ASSERT((unsigned int)zero == (unsigned int)zero);
ASSERT((unsigned int)one != (unsigned int)zero);
ASSERT((unsigned int)zero < (unsigned int)one);
ASSERT((unsigned int)zero <= (unsigned int)one);
ASSERT((unsigned int)zero <= (unsigned int)zero);
ASSERT((unsigned int)one > (unsigned int)zero);
ASSERT((unsigned int)one >= (unsigned int)zero);
ASSERT((unsigned int)one >= (unsigned int)one);
ASSERT((unsigned int)zero == (unsigned int)0);
ASSERT((unsigned int)one != (unsigned int)0);
ASSERT((unsigned int)zero < (unsigned int)1);
ASSERT((unsigned int)zero <= (unsigned int)1);
ASSERT((unsigned int)zero <= (unsigned int)0);
ASSERT((unsigned int)one > (unsigned int)0);
ASSERT((unsigned int)one >= (unsigned int)0);
ASSERT((unsigned int)one >= (unsigned int)1);
ASSERT((unsigned int)0 == (unsigned int)zero);
ASSERT((unsigned int)1 != (unsigned int)zero);
ASSERT((unsigned int)0 < (unsigned int)one);
ASSERT((unsigned int)0 <= (unsigned int)one);
ASSERT((unsigned int)0 <= (unsigned int)zero);
ASSERT((unsigned int)1 > (unsigned int)zero);
ASSERT((unsigned int)1 >= (unsigned int)zero);
ASSERT((unsigned int)1 >= (unsigned int)one);
finished();
}