]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/gcc.dg/altivec-2.c
re PR rtl-optimization/11864 (miscompiles zero extention and test)
[gcc.git] / gcc / testsuite / gcc.dg / altivec-2.c
1 /* { dg-do compile { target powerpc-*-* } } */
2 /* { dg-options "-maltivec" } */
3
4 /* Program to test the vector_size attribute. This needs to run on a
5 target that has vectors, so use AltiVec. */
6
7 #define vector __attribute__((vector_size(16)))
8
9 vector int foobar;
10
11 /* Only floats and integrals allowed. We don't care if they map to SIs. */
12 struct X { int frances; };
13 vector struct X hotdog; /* { dg-error "invalid vector type" } */
14
15 /* Arrays of vectors. */
16 vector char b[10], ouch;
17
18 /* Pointers of vectors. */
19 vector short *shoe, polish;
20
21 int xxx[sizeof(foobar) == 16 ? 69 : -1];
22
23 int nc17[sizeof(shoe) == sizeof (char *) ? 69 : -1];
24
25 code ()
26 {
27 *shoe = polish;
28 b[1] = ouch;
29 }
30
31 vector short
32 hoop ()
33 {
34 return polish;
35 }
This page took 0.039289 seconds and 5 git commands to generate.