view gcc/testsuite/gcc.dg/pr71558.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR tree-optimization/71588 */

/* strcpy must not be pure, but make sure we don't ICE even when
   it is declared incorrectly.  */
char *strcpy (char *, const char *) __attribute__ ((__pure__));
__SIZE_TYPE__ strlen (const char *);
void *malloc (__SIZE_TYPE__);

char a[20];

char *
foo (void)
{
  __SIZE_TYPE__ b = strlen (a);
  char *c = malloc (b);
  return strcpy (c, a);
}