#include <stdio.h>
#include "func_integrity.h"
#include "func_io.h"

extern bool  asm_001_add          ();
extern bool  asm_002_addc         ();
extern bool  asm_003_extend       ();
extern bool  asm_004_sfeq         ();
extern bool  asm_005_sfne         ();
extern bool  asm_006_sfges        ();
extern bool  asm_007_sfgeu        ();
extern bool  asm_008_sfgts        ();
extern bool  asm_009_sfgtu        ();
extern bool  asm_010_sfles        ();
extern bool  asm_011_sfleu        ();
extern bool  asm_012_sflts        ();
extern bool  asm_013_sfltu        ();
extern bool  asm_014_cmov         ();
extern bool  asm_015_shift_rotate ();
extern bool  asm_016_load         ();
extern bool  asm_017_mul          ();

bool test_integrity ()
{
  bool res;

  res = 
    asm_001_add          () &&
    asm_002_addc         () &&
    asm_003_extend       () &&
    asm_004_sfeq         () &&
    asm_005_sfne         () &&
    asm_006_sfges        () &&
    asm_007_sfgeu        () &&
    asm_008_sfgts        () &&
    asm_009_sfgtu        () &&
    asm_010_sfles        () &&
    asm_011_sfleu        () &&
    asm_012_sflts        () &&
    asm_013_sfltu        () &&
    asm_014_cmov         () &&
    asm_015_shift_rotate () &&
    asm_016_load         () &&
    asm_017_mul          () &&
    1;

  if (res == true)
    {
      print(1);
      printf("<test_integrity> Test is Ok\n");
    }
  
  else
    {
      quit(-1);
      printf("<test_integrity> Test is Ko\n");
    }
  
  return res;
}
