summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/builtin-strstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtin-strstr.c')
-rw-r--r--gcc/testsuite/gcc.dg/builtin-strstr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-strstr.c b/gcc/testsuite/gcc.dg/builtin-strstr.c
new file mode 100644
index 000000000..b8201f416
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-strstr.c
@@ -0,0 +1,8 @@
+/* The strstr call is expanded to just "s", which should not result in a
+ warning about discarding qualifiers in an assignment. */
+/* { dg-do compile } */
+extern char * strstr (const char *s1, const char * s2);
+void foo(const char *s){
+ char * cp;
+ cp = strstr(s, "");
+}