From de5d648043cb545cdc61b4a594feb5f879f89b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Poulhi=C3=A8s?= Date: Tue, 20 Apr 2021 19:31:24 +0200 Subject: Fix dg-ice handling in rust testsuite Fix the pruning regex to also match ICE message and allow for dg-ice use. Add the test from #382 as a sample example. Should help #308 --- gcc/testsuite/lib/rust.exp | 2 +- gcc/testsuite/rust.test/xfail_compile/unsafe.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/rust.test/xfail_compile/unsafe.rs (limited to 'gcc') diff --git a/gcc/testsuite/lib/rust.exp b/gcc/testsuite/lib/rust.exp index 7d2896b..528380b3 100644 --- a/gcc/testsuite/lib/rust.exp +++ b/gcc/testsuite/lib/rust.exp @@ -181,7 +181,7 @@ proc rust_target_compile { source dest type options } { ## FIXME: until the compiler is made less verbose, we need to prune its output almost completely. # Only keep lines containing certain diagnostics so that we can check these. global additional_prunes - lappend additional_prunes "^((?!(error: |warning: )).)*$" + lappend additional_prunes "^((?!(error: |warning: |\[Ii\]nternal compiler error: )).)*$" return [target_compile $source $dest $type $options] } diff --git a/gcc/testsuite/rust.test/xfail_compile/unsafe.rs b/gcc/testsuite/rust.test/xfail_compile/unsafe.rs new file mode 100644 index 0000000..632be94 --- /dev/null +++ b/gcc/testsuite/rust.test/xfail_compile/unsafe.rs @@ -0,0 +1,4 @@ +fn main() { // { dg-ice "#382" } + unsafe { + } +} -- cgit v1.1