
export uniform int width() { return programCount; }

uniform double one = 1;

void copy(uniform double dst[], uniform double src[], uniform int count) {
    foreach (i = 0 ... count)
        dst[i] = one * src[i];
}

export void f_f(uniform float RET[], uniform float aFOO[]) {
    uniform int count = 200 + aFOO[1];
    uniform double * uniform src = uniform new uniform double[count];
    for (uniform int i = 0; i < count; ++i)
        src[i] = i;

    uniform double * uniform dst = uniform new uniform double[count];
    copy(dst, src, count);

    uniform int errors = 0;
    for (uniform int i = 0; i < count; ++i)
        if (dst[i] != src[i])
            ++errors;

    RET[programIndex] = errors; 
}

export void result(uniform float RET[]) {
    RET[programIndex] = 0;
}
