From 44e813ecd1fa610e3e4ed2420a69d4a1e200b19c Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 8 Jan 2019 01:39:09 +0000
Subject: [PATCH] Fix jit test case (PR jit/88747)

Amongst other changes, r266077 updated value_range_base::dump so
that it additionally prints the type.  This broke an assertion within
the jit testsuite, in jit.dg/test-sum-of-squares.c, which was checking
for:
  ": [-INF, n_"
but was now getting:
  ": signed int [-INF, n_"

The test is merely intended as a simple verification that we can read
dump files via gcc_jit_context_enable_dump.

This patch loosens the requirements on the dump so that it should work
with either version of value_range_base::dump.

gcc/testsuite/ChangeLog:
	PR jit/88747
	* jit.dg/test-sum-of-squares.c (verify_code): Update expected vrp
	dump to reflect r266077.

From-SVN: r267671
---
 gcc/testsuite/ChangeLog                    | 6 ++++++
 gcc/testsuite/jit.dg/test-sum-of-squares.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 72e9d8e47aa7..23de2ea6f0b0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-07  David Malcolm  <dmalcolm@redhat.com>
+
+	PR jit/88747
+	* jit.dg/test-sum-of-squares.c (verify_code): Update expected vrp
+	dump to reflect r266077.
+
 2019-01-07  Jakub Jelinek  <jakub@redhat.com>
 
 	PR c/88701
diff --git a/gcc/testsuite/jit.dg/test-sum-of-squares.c b/gcc/testsuite/jit.dg/test-sum-of-squares.c
index 46fd5c28c412..f095f419a59a 100644
--- a/gcc/testsuite/jit.dg/test-sum-of-squares.c
+++ b/gcc/testsuite/jit.dg/test-sum-of-squares.c
@@ -137,6 +137,6 @@ verify_code (gcc_jit_context *ctxt, gcc_jit_result *result)
      bounds of the iteration variable. Specifically, verify that some
      variable is known to be in the range negative infinity to some
      expression based on param "n" (actually n-1).  */
-  CHECK_STRING_CONTAINS (dump_vrp1, ": [-INF, n_");
+  CHECK_STRING_CONTAINS (dump_vrp1, "[-INF, n_");
   free (dump_vrp1);
 }
-- 
GitLab