testsuite: Add testcase for already fixed bug [PR97964]
authorJakub Jelinek <jakub@redhat.com>
Tue, 24 Nov 2020 09:42:56 +0000 (10:42 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 24 Nov 2020 09:42:56 +0000 (10:42 +0100)
This testcase started failing with r8-2090 and works again starting
with r11-4755.

2020-11-24  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/97964
* gcc.dg/tree-ssa/pr97964.c: New test.

gcc/testsuite/gcc.dg/tree-ssa/pr97964.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr97964.c b/gcc/testsuite/gcc.dg/tree-ssa/pr97964.c
new file mode 100644 (file)
index 0000000..0ee0196
--- /dev/null
@@ -0,0 +1,18 @@
+/* PR tree-optimization/97964 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-final { scan-tree-dump-not "link_failure \\\(\\\);" "optimized" } } */
+
+void link_failure (void);
+
+void
+foo (int a)
+{
+  long b = -2;
+  int c = a > 0;
+  int d = b * c;
+  int e = 1 - d;
+  int t = (-1 / e) == 1;
+  if (t != 0)
+    link_failure ();
+}