blob: cfc53be4ee1f377ec757edc7588d23635de1088a [file] [log] [blame]
/* { dg-do compile } */
extern "C" double pow(double, double);
template <typename T>
T pow(T x, unsigned int n)
{
if (!n)
return 1;
T y = 1;
while (n > 1)
{
if (n%2)
y *= x;
x = x*x;
n /= 2;
}
return x*y;
}
void testVec(int* x)
{
for (int i = 0; i < 8; ++i)
x[i] = pow(x[i], 10);
}
/* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" { target { vect_double && vect_hw_misalign } } } } */