testsuite: add dg-enable-nn-line-numbers
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 10 Jan 2020 20:14:31 +0000 (20:14 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 10 Jan 2020 20:14:31 +0000 (20:14 +0000)
commit83f604e70683b5356bd1bc330a98a34981aad8f4
tree9343ba6eddf8566aaf230ae6c527f3e138b3ca07
parent60257913f864a5b9f70fbd45ff267cb703075497
testsuite: add dg-enable-nn-line-numbers

This patch adds support for obscuring the line numbers printed in the
left-hand margin when printing the source code, converting them to "NN",
e.g from:

  7111 |   if (!(flags & 0x0001)) {
       |      ^
       |      |
       |      (1) following 'true' branch...
  7112 |

to:

   NN  |   if (!(flags & 0x0001)) {
       |      ^
       |      |
       |      (1) following 'true' branch...
   NN  |

This is useful in followup patches e.g. when testing how interprocedural
paths are printed using multiline.exp, to avoid depending on precise line
numbers.

gcc/testsuite/ChangeLog:
* lib/gcc-dg.exp (cleanup-after-saved-dg-test): Reset global
nn_line_numbers_enabled.
* lib/multiline.exp (nn_line_numbers_enabled): New global.
(dg-enable-nn-line-numbers): New proc.
(maybe-handle-nn-line-numbers): New proc.
* lib/prune.exp (prune_gcc_output): Call maybe-handle-nn-line-numbers.

From-SVN: r280134
gcc/testsuite/ChangeLog
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/multiline.exp
gcc/testsuite/lib/prune.exp