Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/Warray-bounds-12.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-do compile } */ /* { dg-options "-O3 -Warray-bounds" } */ /* { dg-additional-options "-mssse3" { target x86_64-*-* i?86-*-* } } */ void foo(short a[], short m) { int i, j; int f1[10]; short nc; nc = m + 1; if (nc > 3) { for (i = 0; i <= nc; i++) { f1[i] = f1[i] + 1; } } for (i = 0, j = m; i < nc; i++, j--) { a[i] = f1[i]; /* { dg-bogus "above array bounds" } */ a[j] = i; } return; }