Add a testcase for PR 84799

Message ID 20180312132910.GA19253@intel.com
State New
Headers show
Series
  • Add a testcase for PR 84799
Related show

Commit Message

H.J. Lu March 12, 2018, 1:29 p.m.
This is introduced by r258390 and fixed by r258415.

I am checking in this patch to add a testcase for PR 84799.


H.J.
---
	* gcc.dg/pr84799.c: New test.
---
 gcc/testsuite/ChangeLog        |  4 ++++
 gcc/testsuite/gcc.dg/pr84799.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr84799.c

-- 
2.14.3

Patch

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c13747ad1b6..c7193069550 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@ 
+2018-03-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* gcc.dg/pr84799.c: New test.
+
 2018-03-12  Richard Biener  <rguenther@suse.de>
 
 	PR tree-optimization/84803
diff --git a/gcc/testsuite/gcc.dg/pr84799.c b/gcc/testsuite/gcc.dg/pr84799.c
new file mode 100644
index 00000000000..2b3a48f9e34
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr84799.c
@@ -0,0 +1,29 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int a, g;
+long b, f;
+short c, d, e;
+
+static void fn1 ()
+{
+  if (a)
+    {
+      long i = 5, j = b / i | c;
+      int k = b % (d % i) & j;
+      short l = ~f % (-d / j ^ -e), m = e << (d - l);
+      if (k)
+        m = d;
+      i = d | (i & b);
+      g = (c | ~f) % i + l;
+      e = (c - f) & e;
+      d = m;
+    }
+}
+
+int main ()
+{
+  b |= 1;
+  fn1 ();
+  return 0; 
+}