]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Warray-bounds-12.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-12.c
CommitLineData
f101c4b4
RB
1/* { dg-do compile } */
2/* { dg-options "-O3 -Warray-bounds" } */
3/* { dg-additional-options "-mssse3" { target x86_64-*-* i?86-*-* } } */
4
5void foo(short a[], short m)
6{
7 int i, j;
8 int f1[10];
9 short nc;
10
11 nc = m + 1;
12 if (nc > 3)
13 {
14 for (i = 0; i <= nc; i++)
15 {
16 f1[i] = f1[i] + 1;
17 }
18 }
19
20 for (i = 0, j = m; i < nc; i++, j--)
21 {
22 a[i] = f1[i]; /* { dg-bogus "above array bounds" } */
23 a[j] = i;
24 }
25 return;
26}