I added dg-timeout-factor support to compat.exp, so that one can use it in 
struct-layout-1.exp test cases.


To use it, one can do something like:

diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c 
b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
index 80c7355..bc34f2a 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c
@@ -50,7 +50,8 @@ const char *dg_options[] = {
 "/* { dg-options \"%s-I%s -fno-common\" { target hppa*-*-hpux* 
powerpc*-*-darwin* } } */\n",
 "/* { dg-options \"%s-I%s -mno-mmx -fno-common -Wno-abi\" { target 
i?86-*-darwin* x86_64-*-darwin* } } */\n",
 "/* { dg-options \"%s-I%s -mno-base-addresses\" { target mmix-*-* } } */\n",
-"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target 
xtensa*-*-* } } */\n"
+"/* { dg-options \"%s-I%s -mlongcalls -mtext-section-literals\" { target 
xtensa*-*-* } } */\n",
+"/* { dg-timeout-factor 10 } */\n"
 #define NDG_OPTIONS (sizeof (dg_options) / sizeof (dg_options[0]))
 };

if they want.  On my target and my usual host environment, I randomly get 
timeouts on linking.  The default of 300 doesn’t seem to be enough.

I don’t know if others hit this (I’m -j24 with 128 GB ram on a local zfs with 
spinning rust under it), so I didn’t bother checking in the above.  If others 
want to report on wether they see random link failures, I’d be happy to check 
it in, let me know.


 
        * lib/compat.exp (compat-get-options-main): Add dg-timeout-factor
        support for struct-layout-1.exp.

diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index 77d6705..63d78cc 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -170,7 +170,8 @@ proc compat-get-options-main { src } {
        if { ![string compare "dg-options" $cmd] \
             || [string match "dg-prune-output" $cmd] \
             || [string match "dg-skip-if" $cmd] \
-            || [string match "dg-require-*" $cmd]  } {
+            || [string match "dg-require-*" $cmd] \
+            || [string match "dg-timeout-factor" $cmd]  } {
            set status [catch "$op" errmsg]
            if { $status != 0 } {
                perror "src: $errmsg for \"$op\"\n"
@@ -215,7 +216,8 @@ proc compat-get-options { src } {
        set cmd [lindex $op 0]
        if { ![string compare "dg-options" $cmd] \
             || ![string compare "dg-prune-output" $cmd] \
-            || ![string compare "dg-xfail-if" $cmd] } {
+            || ![string compare "dg-xfail-if" $cmd] \
+            || ![string compare "dg-timeout-factor" $cmd] } {
            set status [catch "$op" errmsg]
            if { $status != 0 } {
                perror "src: $errmsg for \"$op\"\n"

Reply via email to