Exemple #1
0
int main(int argc, char *argv[])
{
	int err;
	int match;
	uint64_t match_bits;
	int op;
	int type;
	datatype_t tgt, din, dout, z;
	int length;
	time_t cur_time = time(NULL);
	int fetch;

	seed = cur_time;

	err = arg_process(argc, argv);
	if (err)
		goto done;

	srandom(seed);

	/* Generate one of each kind. */
	for (fetch =0; fetch <= 1; fetch ++) {

		for (op=PTL_MIN; op<=PTL_BXOR; op++) {

			for (type = PTL_INT8_T; type <= PTL_LONG_DOUBLE_COMPLEX; type ++) {

				if (!check_op_type_valid(op, type))
					continue;

				match = random() & 1;
				match_bits = random();
				match_bits = match_bits << 32 | random();

				tgt = get_data(type);
				dout = get_data(type);
				din = get_data(type);
				z = get_result(tgt, dout, op, type);

				length = random() % (max_length/atom_type[type].size);
				length = (length + 1)*atom_type[type].size;

				generate_case(op, type, match, match_bits, din, dout, tgt,
							  z, length, fetch);
			}
		}
	}

	err = 0;

 done:
	return err;
}
Exemple #2
0
void			generate_resources(t_list *map)
{
    t_list		*tmp;
    t_list		*y_tmp;

    if (map)
    {
        tmp = map->begin;
        while (tmp)
        {
            y_tmp = tmp->data;
            while (y_tmp)
            {
                if (y_tmp->data)
                    generate_case(y_tmp->data);
                y_tmp = y_tmp->next;
            }
            tmp = tmp->next;
        }
    }
}