Exemplo n.º 1
0
void
test_unary_op(const irop_t *op, test_data_t *data)
{
    unsigned num_input_bits, bitpos;

    num_input_bits = bitsof_irtype(data->opnds[0].type);

    for (bitpos = 0; bitpos < num_input_bits; ++bitpos) {
        data->opnds[0].vbits = onehot_vbits(bitpos, num_input_bits);

        valgrind_execute_test(op, data);

        check_result_for_unary(op, data);
    }
}
Exemplo n.º 2
0
int
test_unary_op(const irop_t *op, test_data_t *data)
{
   unsigned num_input_bits, bitpos;
   int tests_done = 0;

   /* Immediate operands are currently not supported here */
   assert(op->immediate_index == 0);

   num_input_bits = bitsof_irtype(data->opnds[0].type);

   for (bitpos = 0; bitpos < num_input_bits; ++bitpos) {
      data->opnds[0].vbits = onehot_vbits(bitpos, num_input_bits);

      valgrind_execute_test(op, data);

      check_result_for_unary(op, data);
      tests_done++;
   }
   return tests_done;
}