view gcc/testsuite/gcc.dg/pr87099.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* PR middle-end/87099 */
/* { dg-do compile } */
/* { dg-require-effective-target alloca } */
/* { dg-options "-Wstringop-overflow" } */

void bar (char *);

int
foo (int n)
{
  char v[n];
  bar (v);
  return __builtin_strncmp (&v[1], "aaa", 3);
}

int
baz (int n, char *s)
{
  char v[n];
  bar (v);
  return __builtin_strncmp (&v[1], s, 3);
}