2015-06-05 17:57:34 +02:00
|
|
|
/* { dg-do run } */
|
2015-06-15 20:10:51 +02:00
|
|
|
/* { dg-additional-options "-ftree-parallelize-loops=2" } */
|
2015-06-05 17:57:34 +02:00
|
|
|
|
2015-06-13 10:05:44 +02:00
|
|
|
/* Constant bound, vector addition. */
|
|
|
|
|
2015-06-05 17:57:34 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#define N 1000
|
|
|
|
|
|
|
|
unsigned int a[N];
|
|
|
|
unsigned int b[N];
|
|
|
|
unsigned int c[N];
|
|
|
|
|
|
|
|
void __attribute__((noclone,noinline))
|
|
|
|
f (void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < N; ++i)
|
|
|
|
c[i] = a[i] + b[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (void)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
/* Complexify loop to inhibit parloops. */
|
|
|
|
for (j = 0; j < 100; ++j)
|
|
|
|
for (i = 0; i < 10; i++)
|
|
|
|
{
|
|
|
|
int k = i + (10 * j);
|
|
|
|
a[k] = k;
|
|
|
|
b[k] = (k * 3) % 7;
|
|
|
|
c[k] = k * 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
f ();
|
|
|
|
|
|
|
|
for (i = 0; i < N; i++)
|
|
|
|
{
|
|
|
|
unsigned int actual = c[i];
|
|
|
|
unsigned int expected = i + ((i * 3) % 7);
|
|
|
|
if (actual != expected)
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|