summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Warray-bounds-23.c
blob: 2addc358310e6d505303c39a38c65f0a2b788f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O2 -Warray-bounds" } */

int main()
{
  unsigned i, j, a[10] = {0};

  for (j = 23; j < 25; j++){
      for (i = j / 8; i --> 0;) a[i] = 0; /* { dg-bogus "array bounds" } */
      for (i =     1; i --> 0;) __builtin_printf("%u", a[i]);
  }

  return 0;
}