summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vector-subscript-3.c
blob: 55ed2b370258329d5538e9bb356ebe49fdfa5146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Check the case when index is out of bound */
/* { dg-do compile } */
/* { dg-options "-Warray-bounds" } */

#define vector __attribute__((vector_size(16) ))


int test0(void)
{
  vector int a;
  return a[10]; /* { dg-warning "index value is out of bound" } */
}

int test1(void)
{
  vector int a;
  return a[-1]; /* { dg-warning "index value is out of bound" } */
}