예제 #1
0
파일: atomic-op-1.c 프로젝트: ChaosJohn/gcc
main ()
{
  test_fetch_add ();
  test_fetch_sub ();
  test_fetch_and ();
  test_fetch_nand ();
  test_fetch_xor ();
  test_fetch_or ();

  test_add_fetch ();
  test_sub_fetch ();
  test_and_fetch ();
  test_nand_fetch ();
  test_xor_fetch ();
  test_or_fetch ();

  test_add ();
  test_sub ();
  test_and ();
  test_nand ();
  test_xor ();
  test_or ();

  return 0;
}
예제 #2
0
/*
 * A single random test
 * - pick two existing bits x and y
 * - select between OR and XOR randomly
 */
static void random_test(void) {
  bit_t x, y;

  x = random_bit();
  y = random_bit();
  if (random() & 0x8000) {
    test_or(x, y);
  } else {
    test_xor(x, y);
  }
}
예제 #3
0
int main()
{

    try
    {
        test_xor();
        //test_multilayer();
    }
    catch(const char* err)
    {
        std::cerr << err << std::endl;
    }
    //getchar();
    return 0;
}
예제 #4
0
/*
 * Test all pairwise combinations of existing terms
 */
static void test_all_pairs(void) {
  uint32_t n;
  bit_t x, y;

  n = max+1;
  for (x = 0; x<n; x++) {
    if (! fresh[x]) {
      for (y=0; y<n; y++) {
	if (! fresh[y]) {
	  test_or(x, y);
	  test_xor(x, y);
	}
      }
    }
  }
}
예제 #5
0
int
main ()
{
  test_fetch_add ();
  test_fetch_sub ();
  test_fetch_and ();
  test_fetch_xor ();
  test_fetch_or ();

  test_add ();
  test_sub ();
  test_and ();
  test_xor ();
  test_or ();

  return 0;
}
예제 #6
0
파일: alu.cpp 프로젝트: jpd002/ps2autotests
int main(int argc, char **argv) {
	printf("-- TEST BEGIN\n");

	test_addu();
	test_addiu();
	test_and();
	test_andi();
	test_daddu();
	test_daddiu();
	test_dsll();
	test_dsll32();
	test_dsllv();
	test_dsra();
	test_dsra32();
	test_dsrav();
	test_dsrl();
	test_dsrl32();
	test_dsrlv();
	test_dsubu();
	test_lui();
	test_movn();
	test_movz();
	test_nor();
	test_or();
	test_ori();
	test_sll();
	test_sllv();
	test_slt();
	test_slti();
	test_sltiu();
	test_sltu();
	test_sra();
	test_srav();
	test_srl();
	test_srlv();
	test_subu();
	test_xor();
	test_xori();

	printf("-- TEST END\n");

	return 0;
}
예제 #7
0
파일: main.c 프로젝트: handgod/soma
int main(int argc, char *argv[])
{
    printf("test_init...\n");
    test_init();

    printf("test_bits...\n");
    test_bits();

    printf("test_clear...\n");
    test_clear();

    printf("test_modify...\n");
    test_modify();

    printf("test_xor...\n");
    test_xor();

    printf("done.\n");
    return 0;
}
예제 #8
0
int main()
{
	union mips_instruction inst;
	struct virtual_mem_region* memory = NULL;
	struct context ctx;

	// I-type
	test_addi(inst, memory, ctx);
	test_addiu(inst, memory, ctx);
	test_andi(inst, memory, ctx);
	test_ori(inst, memory, ctx);
	test_xori(inst, memory, ctx);
	test_lui(inst, memory, ctx);
	test_slti(inst, memory, ctx);
	test_sltiu(inst, memory, ctx);
	test_sw(inst, memory, ctx);
	test_lw(inst, memory, ctx);
	test_sb(inst, memory, ctx);
	test_lb(inst, memory, ctx);
	test_beq(inst, memory, ctx);
	test_bne(inst, memory, ctx);
	test_bgez(inst, memory, ctx);
	test_bgtz(inst, memory, ctx);
	test_blez(inst, memory, ctx);
	test_bltz(inst, memory, ctx);

	// R-type
	test_add(inst, memory, ctx);
	test_addu(inst, memory, ctx);
	test_sub(inst, memory, ctx);
	test_subu(inst, memory, ctx);
	test_and(inst, memory, ctx);
	test_or(inst, memory, ctx);
	test_xor(inst, memory, ctx);
	test_slt(inst, memory, ctx);
	test_sltu(inst, memory, ctx);

	printf("\nAll tests completed successfully!\n");
	return 0;
}
예제 #9
-1
/*
 * Test all combinations of x and y
 */
static void multi_test(bit_t x, bit_t y) {
  test_or(x, y);
  test_or(bit_not(x), y);
  test_or(x, bit_not(y));
  test_or(bit_not(x), bit_not(y));

  test_or(y, x);
  test_or(y, bit_not(x));
  test_or(bit_not(y), x);
  test_or(bit_not(y), bit_not(x));

  test_xor(x, y);
  test_xor(bit_not(x), y);
  test_xor(x, bit_not(y));
  test_xor(bit_not(x), bit_not(y));

  test_xor(y, x);
  test_xor(bit_not(y), x);
  test_xor(y, bit_not(x));
  test_xor(bit_not(y), bit_not(x));
}