| 1 |
/* PR middle-end/19967 |
| 2 |
These functions mentioned below are supposed to return char *. |
| 3 |
However, fold_builtin_... had bugs that caused the return types to |
| 4 |
be const char *. */ |
| 5 |
|
| 6 |
/* { dg-do compile } */ |
| 7 |
/* { dg-options "-pedantic -std=c99" } */ |
| 8 |
|
| 9 |
char *strchr(const char *, int); |
| 10 |
char *strrchr(const char *, int); |
| 11 |
char *index(const char *, int); |
| 12 |
char *rindex(const char *, int); |
| 13 |
char *strpbrk(const char *, const char *); |
| 14 |
char *strstr(const char *, const char *); |
| 15 |
char *p; |
| 16 |
|
| 17 |
void |
| 18 |
f (void) |
| 19 |
{ |
| 20 |
p = strchr(__func__, 'f'); |
| 21 |
p = strrchr(__func__, 'f'); |
| 22 |
p = index(__func__, 'f'); |
| 23 |
p = rindex(__func__, 'f'); |
| 24 |
p = strpbrk(__func__, "f"); |
| 25 |
p = strstr(__func__, "f"); |
| 26 |
} |