PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-17.c
blobe790037feb15aaa12041ef0b1c53036bc072b194
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -Warray-bounds" } */
4 char *y;
5 void foo (int sysnum)
7 static char *x[] = {};
8 int nsyscalls = sizeof x / sizeof x[0];
9 if (sysnum < 0 || sysnum >= nsyscalls)
10 return;
11 else
12 y = x[sysnum]; /* { dg-bogus "above array bounds" } */