testsuite: Add testcases for already fixed PR [PR93927]
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 Mar 2020 06:58:12 +0000 (07:58 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 3 Mar 2020 06:58:12 +0000 (07:58 +0100)
2020-03-03  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/93927
* gcc.c-torture/compile/pr93927-1.c: New test.
* gcc.c-torture/compile/pr93927-2.c: New test.

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr93927-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/compile/pr93927-2.c [new file with mode: 0644]

index 6418eb2fd9408971a0f6e5bef86c30f02781479b..2e316a3f7447e906438474513d585bf125d431a0 100644 (file)
@@ -1,3 +1,9 @@
+2020-03-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/93927
+       * gcc.c-torture/compile/pr93927-1.c: New test.
+       * gcc.c-torture/compile/pr93927-2.c: New test.
+
 2020-03-03  Jun Ma <JunMa@linux.alibaba.com>
 
        * g++.dg/coroutines/torture/co-await-14-template-traits.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr93927-1.c b/gcc/testsuite/gcc.c-torture/compile/pr93927-1.c
new file mode 100644 (file)
index 0000000..c77521f
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR tree-optimization/93927 */
+
+__SIZE_TYPE__ strstr (const char *, const char *);
+
+char *
+foo (char *x)
+{
+  return !!strstr (x, "0") ? "0" : "1";
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr93927-2.c b/gcc/testsuite/gcc.c-torture/compile/pr93927-2.c
new file mode 100644 (file)
index 0000000..4834ece
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR tree-optimization/93927 */
+
+__SIZE_TYPE__ strchr (const char *, int);
+
+char *
+foo (char *x)
+{
+  return !!strchr (x, 0) ? "0" : "1";
+}