aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/vec-shr.c
blob: 31a27c8832dd561af65ce65b80cb2c78f1de442c (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
/* { dg-do run } */
/* { dg-options "-O3 -fno-inline" } */

#include <stdlib.h>

typedef struct { double r, i; } complex;
#define LEN 30
complex c[LEN];
double d[LEN];

void
foo (complex *c, double *d, int len1)
{
  int i;
  for (i = 0; i < len1; i++)
    {
      c[i].r = d[i];
      c[i].i = 0.0;
    }
}

int
main (void)
{
  int i;
  for (i = 0; i < LEN; i++)
    d[i] = (double) i;
  foo (c, d, LEN);
  for (i=0;i<LEN;i++)
    if ((c[i].r != (double) i) || (c[i].i != 0.0))
      abort ();
  return 0;
}