PR middle-end/27945
[official-gcc.git] / gcc / testsuite / gcc.dg / pr19967.c
blob85afeafe2858aee5f5cbd74832849eab0fbcca24
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 *. */
6 /* { dg-do compile } */
7 /* { dg-options "-pedantic" } */
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;
17 void
18 f (void)
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");