testcase for last_vuse in FRE

Message ID nycvar.YFH.7.76.2002251221490.5137@zhemvz.fhfr.qr
State New
Headers show
Series
  • testcase for last_vuse in FRE
Related show

Commit Message

Richard Biener Feb. 25, 2020, 11:21 a.m.
This adds a testcase for some basic FRE functionality.

2020-02-25  Richard Biener  <rguenther@suse.de>

	* gcc.dg/tree-ssa/ssa-fre-86.c: New testcase.
---
 gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c

-- 
2.12.3

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c
new file mode 100644
index 00000000000..d3da22c46c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-86.c
@@ -0,0 +1,20 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre1" } */
+
+int foo(int *p, int b, float *q)
+{
+  int tem;
+  if (b)
+    {
+      *q = 0;
+      tem = *p;
+    }
+  else
+    {
+      *q = 1;
+      tem = *p;
+    }
+  return *p - tem;
+}
+
+/* { dg-final { scan-tree-dump "return 0;" "fre1" } } */