Skip to content

Commit 042c875

Browse files
bors[bot]liushuyu
andauthored
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>
2 parents d17e0aa + e909e4f commit 042c875

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

gcc/testsuite/lib/rust.exp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ proc rust_target_compile { source dest type options } {
166166
global gluefile wrap_flags
167167
global ALWAYS_RUSTFLAGS
168168
global RUST_UNDER_TEST
169+
global individual_timeout
170+
171+
# HACK: guard against infinite loops in the compiler
172+
set individual_timeout 10
169173

170174
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
171175
lappend options "libs=${gluefile}"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// { dg-excess-errors "...." { xfail *-*-*-* } }
2+
3+
macro_rules! add {
4+
($a:expr) => { $a };
5+
($a:expr, $($b:expr),+) => { $a + add!($($b),*) }
6+
}
7+
8+
fn main() -> i32 {
9+
add!(add!(1, 2))
10+
}

0 commit comments

Comments
 (0)