testsuite: Introduce dg-ice.
authorMarek Polacek <polacek@redhat.com>
Fri, 24 Jul 2020 02:20:37 +0000 (22:20 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 10 Aug 2020 21:01:47 +0000 (17:01 -0400)
commit636686662326496f68451e7eb91882fe462f850a
treec6eaaabf15321e280ce903db7266798bcef821ca
parente4ced0b60ccb4c944970304cf74f1ee9086e5553
testsuite: Introduce dg-ice.

This patch adds a new DejaGNU directive, dg-ice, as outlined in the
proposal here:
https://gcc.gnu.org/pipermail/gcc-patches/2020-July/550913.html

It means that it's expected that the compiler crashes with an internal
compiler error when compiling test with such a directive.

A minor optimization could be to use -pass-exit-codes and then check for
ICE_EXIT_CODE return code instead of using string match.

gcc/ChangeLog:

* doc/sourcebuild.texi: Document dg-ice.

gcc/testsuite/ChangeLog:

* lib/gcc-dg.exp (gcc-dg-test-1): Handle dg-ice.
(cleanup-after-saved-dg-test): Reset expect_ice.
* lib/prune.exp (prune_ices): New.
* lib/target-supports-dg.exp (dg-ice): New.
gcc/doc/sourcebuild.texi
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/prune.exp
gcc/testsuite/lib/target-supports-dg.exp