summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/altivec-cell-5.c
blob: 95f109d1abeffddace062b8cedf215a66fc8ee93 (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
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-options "-maltivec" } */

/* Basic test for the new VMX intrinsics and error messages.  */
#include <altivec.h>

int main(int argc, char **argv)
{
vector float t;
    vec_promote();                      /* { dg-error "vec_promote only accepts 2" } */
    vec_promote(1.0f);                  /* { dg-error "vec_promote only accepts 2" } */
    vec_promote(1.0f, 2, 3);            /* { dg-error "vec_promote only accepts 2" } */
    vec_extract ();                     /* { dg-error "vec_extract only accepts 2" } */
    vec_extract (t);                    /* { dg-error "vec_extract only accepts 2" } */
    vec_extract (t, 2);
    vec_extract (t, 2, 5, 6);           /* { dg-error "vec_extract only accepts 2" } */
    vec_splats ();                      /* { dg-error "vec_splats only accepts 1" } */
    vec_splats (t, 3);                  /* { dg-error "vec_splats only accepts 1" } */
    vec_insert ();                      /* { dg-error "vec_insert only accepts 3" } */
    vec_insert (t);                     /* { dg-error "vec_insert only accepts 3" } */
    vec_insert (t, 3);                  /* { dg-error "vec_insert only accepts 3" } */
    vec_insert (t, 3, 2, 4, 6, 6);      /* { dg-error "vec_insert only accepts 3" } */
    return 0;
}