aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-15 21:08:17 +0000
committerGitHub <noreply@github.com>2022-04-15 21:08:17 +0000
commit042c8750245e011e3585b56f9080126636f10444 (patch)
tree833cccdc04c728043a3048d1f5e0ba5f998c47ba /gcc
parentd17e0aa7695ddb383e0a4fc43185e2ab42c81703 (diff)
parente909e4fc7b2c46cadf15ea114622241f39337673 (diff)
downloadgcc-042c8750245e011e3585b56f9080126636f10444.zip
gcc-042c8750245e011e3585b56f9080126636f10444.tar.gz
gcc-042c8750245e011e3585b56f9080126636f10444.tar.bz2
Merge #1107
1107: tests: Improve timeout handling r=philberty a=liushuyu - add a 10-second timeout for individual compile test - add a xfail test case to ensure the timeout mechanism is working Co-authored-by: liushuyu <liushuyu011@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/lib/rust.exp4
-rw-r--r--gcc/testsuite/rust/compile/xfail/macro_return.rs10
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/rust.exp b/gcc/testsuite/lib/rust.exp
index 2c2f3a4..6993c97 100644
--- a/gcc/testsuite/lib/rust.exp
+++ b/gcc/testsuite/lib/rust.exp
@@ -166,6 +166,10 @@ proc rust_target_compile { source dest type options } {
global gluefile wrap_flags
global ALWAYS_RUSTFLAGS
global RUST_UNDER_TEST
+ global individual_timeout
+
+ # HACK: guard against infinite loops in the compiler
+ set individual_timeout 10
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
diff --git a/gcc/testsuite/rust/compile/xfail/macro_return.rs b/gcc/testsuite/rust/compile/xfail/macro_return.rs
new file mode 100644
index 0000000..0eb69fa
--- /dev/null
+++ b/gcc/testsuite/rust/compile/xfail/macro_return.rs
@@ -0,0 +1,10 @@
+// { dg-excess-errors "...." { xfail *-*-*-* } }
+
+macro_rules! add {
+ ($a:expr) => { $a };
+ ($a:expr, $($b:expr),+) => { $a + add!($($b),*) }
+}
+
+fn main() -> i32 {
+ add!(add!(1, 2))
+}