summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vmx/pr27842.c
blob: ad3130d007d8161012e4ec87b064516a9fa46934 (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
#include <altivec.h>

extern void abort (void);
extern int memcmp (const void *, const void *, __SIZE_TYPE__);

void test (vector float *p, int n)
{
  int i;
  for (i = 0; i < n; i++)
    p[i] = vec_abs (p[i]);
}

int
main (void)
{
  vector float p = (vector float){ 0.5, 0.5, 0.5, 0.5 };
  vector float q = p;

  test (&p, 1);

  if (memcmp (&p, &q, sizeof (p)))
    abort ();

  return 0;
}