boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

007-compare.c (432B)


      1 /* tests/cc-e2e/07-compare.c — relational operators.
      2  * Split from 01-kitchen-sink. */
      3 
      4 int test_compare(void) {
      5     int r = 0;
      6     if (5 == 5) r = r + 1;
      7     if (5 != 6) r = r + 2;
      8     if (5 <  6) r = r + 4;
      9     if (6 >  5) r = r + 8;
     10     if (5 <= 5) r = r + 16;
     11     if (5 >= 5) r = r + 32;
     12     return r;                       /* 63 */
     13 }
     14 
     15 int main(int argc, char **argv) {
     16     if (test_compare() != 63) return 1;
     17     return 0;
     18 }