view gcc/testsuite/c-c++-common/vector-subscript-3.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* 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" } */
}