public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Fix copy&paste bug in function-tests.c
@ 2016-07-19 13:05 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2016-07-19 13:05 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

I made a copy&paste error when writing
selftest::verify_three_block_rtl_cfg, forgetting to update the
basic block ptr when asserting the value of "flags".

Fixed thusly.

Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu.
Verified -fself-test of stage1 on powerpc-ibm-aix7.1.3.0.

Committed to trunk (r238470) under the "obvious" rule.

gcc/ChangeLog:
	* function-tests.c (selftest::verify_three_block_rtl_cfg): Verify
	the flags of the exit block and bb2, not just the entry block.
---
 gcc/function-tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/function-tests.c b/gcc/function-tests.c
index edd355f..a59a066 100644
--- a/gcc/function-tests.c
+++ b/gcc/function-tests.c
@@ -433,14 +433,14 @@ verify_three_block_rtl_cfg (function *fun)
 
   basic_block exit = EXIT_BLOCK_PTR_FOR_FN (fun);
   ASSERT_TRUE (exit != NULL);
-  ASSERT_EQ (BB_RTL, entry->flags & BB_RTL);
+  ASSERT_EQ (BB_RTL, exit->flags & BB_RTL);
   ASSERT_EQ (NULL, BB_HEAD (exit));
 
   /* The "real" basic block should be flagged as RTL, and have one
      or more insns.  */
   basic_block bb2 = get_real_block (fun);
   ASSERT_TRUE (bb2 != NULL);
-  ASSERT_EQ (BB_RTL, entry->flags & BB_RTL);
+  ASSERT_EQ (BB_RTL, bb2->flags & BB_RTL);
   ASSERT_TRUE (BB_HEAD (bb2) != NULL);
 }
 
-- 
1.8.5.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-19 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 13:05 [committed] Fix copy&paste bug in function-tests.c David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).