summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vector-subscript-1.c
blob: 7cc50af999be74f8c6460980020fcf3b1c424d84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-options "-w" } */

#define vector __attribute__((vector_size(16) ))
/* Check that vector[index] works and index[vector] is rejected.  */

float vf(vector float a)
{
  return 0[a]; /* { dg-error "subscripted value is neither array nor pointer nor vector" } */
}


float fv(vector float a)
{
  return a[0];
}