summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Warray-bounds-34.c
blob: cea7c4b32a220a60b6a8d6c59a17cc7bee2395ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR tree-optimization/86650 - -Warray-bounds missing inlining context
   { dg-do compile }
   { dg-options "-O2 -Warray-bounds" } */

int a[3];           /* { dg-message "while referencing .a." } */
int x;

inline void foo (int i)
{
  a[i + 1] = 123;   /* { dg-warning "\\\[-Warray-bounds]" } */
}

int bar (void)
{
  foo (3);

  return x;
}