aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.apple/altivec-test-macro.c
blob: 6d5a2dc894d0336483bec7ebde1fc3c627f6e25e (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
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-options "-maltivec" } */

#include <altivec.h>

#define TYPE unsigned int
union U {
	TYPE ui[4];
	vector TYPE uv;
} data;

extern void abort();

int main( void )
{
        vector unsigned int v = {1,2,3,4};
        vector TYPE     UUUUUU = {10,10,10,10};
	int i;

        v = vec_add( v, UUUUUU );

	data.uv = v;

	for (i=0; i < 4; i++)
	   if (data.ui[i] != (10+i+1))
	     abort();

        return 0;
}