2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr19967.c
blob68c7e1cb99c9929a16b757d9337ddd94844141c7
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 -std=c99" } */
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");