blob: 93a7da2ee8d1609ab9f7c1cf7976c8f80c388aaa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/* { dg-do run } */
extern void abort (void);
void __attribute__((noinline,noclone))
foo (double *b, double *d, double *f)
{
int i;
for (i = 0; i < 1024; i++)
{
d[2*i] = 2. * d[2*i];
d[2*i+1] = 4. * d[2*i+1];
b[i] = d[2*i] - 1.;
f[i] = d[2*i+1] + 2.;
}
}
int main()
{
double b[1024], d[2*1024], f[1024];
int i;
for (i = 0; i < 2*1024; i++)
d[i] = 1.;
foo (b, d, f);
for (i = 0; i < 1024; i+= 2)
{
if (d[2*i] != 2.)
abort ();
if (d[2*i+1] != 4.)
abort ();
}
for (i = 0; i < 1024; i++)
{
if (b[i] != 1.)
abort ();
if (f[i] != 6.)
abort ();
}
return 0;
}
/* { dg-final { cleanup-tree-dump "vect" } } */
|