OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [loop-13.c] - Blame information for rev 825

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR opt/7130 */
2
#define TYPE long
3
 
4
void
5
scale (TYPE *alpha, TYPE *x, int n)
6
{
7
  int i, ix;
8
 
9
  if (*alpha != 1)
10
    for (i = 0, ix = 0; i < n; i++, ix += 2)
11
      {
12
        TYPE tmpr, tmpi;
13
        tmpr = *alpha * x[ix];
14
        tmpi = *alpha * x[ix + 1];
15
        x[ix] = tmpr;
16
        x[ix + 1] = tmpi;
17
      }
18
}
19
 
20
int
21
main (void)
22
{
23
  int i;
24
  TYPE x[10];
25
  TYPE alpha = 2;
26
 
27
  for (i = 0; i < 10; i++)
28
    x[i] = i;
29
 
30
  scale (&alpha, x, 5);
31
 
32
  if (x[9] != 18)
33
    abort ();
34
 
35
  return 0;
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.