gcc/testsuite/gcc.c-torture/compile/pr40035.c
raw| 1 | typedef __SIZE_TYPE__ size_t; |
| 2 | void *memmove (void *dest, const void *src, size_t count); |
| 3 | size_t strlen (const char *s); |
| 4 | |
| 5 | int |
| 6 | foo (char *param, char *val) |
| 7 | { |
| 8 | if (val) |
| 9 | { |
| 10 | if (val == param + strlen (param) + 1) |
| 11 | val[-1] = '='; |
| 12 | else if (val == param + strlen (param) + 2) |
| 13 | { |
| 14 | val[-2] = '='; |
| 15 | memmove (val - 1, val, strlen (val) + 1); |
| 16 | val--; |
| 17 | } |
| 18 | } |
| 19 | return 0; |
| 20 | } |