OSDN Git Service

2009-07-17 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / altivec-6.C
1 /* Test for correct handling of literal arguments. */
2 /* Author: Ziemowit Laski  <zlaski@apple.com>  */
3 /* { dg-do compile { target powerpc*-*-* } } */
4 /* { dg-require-effective-target powerpc_altivec_ok } */
5 /* { dg-options "-maltivec" } */
6
7 #include <altivec.h>
8
9 void foo(void) {
10   const unsigned char *buf;
11   vector pixel vp = { 3, 4, 5, 6 };
12   vector bool int vbi = { 1, 0, 1, 0 };
13   vector bool short vbs = { 1, 0, 1, 0, 1, 0, 1, 0 };
14   vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 };
15   vector signed char vsc;
16   int a = 3;
17   
18   vec_dst(buf, a, 1);
19   vec_dstst(buf, a, 2);
20   vec_dststt(buf, a, 3);
21   vec_dststt(buf, a, 2);
22
23   vp = vec_sld(vp, vp, 5);
24   vbc = vec_splat(vbc, 7);
25   vbs = vec_splat(vbs, 12);
26   vp = vec_splat(vp, 17);
27   vbi = vec_splat(vbi, 31);  
28 }