aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr98721-1.c
blob: 1c7574fb8838a1e2f3166d6cdc9c56b67bcea965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* PR tree-optimization/98721 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-require-effective-target alloca } */

int
foo (int n)
{
  if (n <= 0)
    {
      char vla[n];			/* { dg-message "source object 'vla' of size 0" } */
      return __builtin_strlen (vla);	/* { dg-warning "'__builtin_strlen' reading 1 or more bytes from a region of size 0" } */
    }
  return -1;
}