cconst.c 1.07 KB
#include "os.h"
#include "corefunc.h"

int
cconst( void )
{
  int numFailures = 0;
  static s64 i1 = 34567890123LL + 1111111111LL;
  static s64 i2 = 34567890123LL - 1111111111LL;
  static s64 i3 = 34567890123LL * -10LL;
  static s64 i4 = -34567890123LL / 10LL ;
  static s64 i5 = 34567890123LL % 1000000000LL;
  static s64 i6 = 0xabcdabcdabcdLL << 4;
  static s64 i7 = 0xabcdabcdabcdLL >> 36;
  static s64 i8 = 0xabcdabcdabcdLL & 0x111111111111LL;
  static s64 i9 = 0xabcdabcdabcdLL ^ 0x111111111111LL;
  static s64 i10 = 0xabcdabcdabcdLL | 0x111111111111LL;
  
  numFailures += check_equal(i1, 35679001234LL);

  numFailures += check_equal(i2, 33456779012LL);

  numFailures += check_equal(i3, -345678901230LL);

  numFailures += check_equal(i4, -3456789012LL);

  numFailures += check_equal(i5, 567890123LL);

  numFailures += check_equal(i6, 0xabcdabcdabcd0LL);

  numFailures += check_equal(i7, 0xabcLL);

  numFailures += check_equal(i8, 0x10101010101LL);

  numFailures += check_equal(i9, 0xbadcbadcbadcLL);

  numFailures += check_equal(i10, 0xbbddbbddbbddLL);
  return(numFailures);

}