]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Warray-bounds-6.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-6.c
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -Wall" } */
3 /* based on PR 37861 */
4
5 extern int printf (__const char *__restrict __format, ...);
6
7 static int f3(int v)
8 {
9 int i,j = 0;
10 for (i = 0; i <= v; i++)
11 j++;
12 return j;
13 }
14
15 static int f2(char formatstr[10][100]) {
16 printf( "%d %s\n", 0, formatstr[f3(0)] );
17 printf( "%d %s\n", 1, formatstr[f3(1)] );
18 printf( "%d %s\n", 2, formatstr[f3(2)] );
19 printf( "%d %s\n", 3, formatstr[f3(3)] );
20 return 3;
21 }
22
23 static char formatstr[10][100];
24 int main( void ) {
25 int anz;
26 anz = f2(formatstr);
27 printf( " %d\n",anz);
28 return 0;
29 }