gcc/testsuite/gcc.dg/pr71558.c
raw| 1 | /* PR tree-optimization/71588 */ |
| 2 | |
| 3 | /* strcpy must not be pure, but make sure we don't ICE even when |
| 4 | it is declared incorrectly. */ |
| 5 | char *strcpy (char *, const char *) __attribute__ ((__pure__)); |
| 6 | __SIZE_TYPE__ strlen (const char *); |
| 7 | void *malloc (__SIZE_TYPE__); |
| 8 | |
| 9 | char a[20]; |
| 10 | |
| 11 | char * |
| 12 | foo (void) |
| 13 | { |
| 14 | __SIZE_TYPE__ b = strlen (a); |
| 15 | char *c = malloc (b); |
| 16 | return strcpy (c, a); |
| 17 | } |