From: Maxim Kuvyrkov Date: Tue, 24 Mar 2015 17:19:34 +0000 (+0000) Subject: Backport testsuite race fix from mainline X-Git-Tag: releases/gcc-4.9.3~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a784fbb61cab0d59506e18087dfc04cf6d9273;p=thirdparty%2Fgcc.git Backport testsuite race fix from mainline Backport from mainline: 2015-02-19 Maxim Kuvyrkov PR testsuite/65116 * lib/target-supports.exp (check_compile): Check whether additional_sources is defined before using it. 2015-02-19 Maxim Kuvyrkov * lib/target-supports.exp (check_compile): Save/restore additional_sources that may belong to an actual test. From-SVN: r221639 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0b61978ea3b2..5ae1bf25077c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2015-03-24 Maxim Kuvyrkov + + Backport from mainline: + + 2015-02-19 Maxim Kuvyrkov + PR testsuite/65116 + * lib/target-supports.exp (check_compile): Check whether + additional_sources is defined before using it. + + 2015-02-19 Maxim Kuvyrkov + * lib/target-supports.exp (check_compile): Save/restore + additional_sources that may belong to an actual test. + 2015-03-24 Uros Bizjak PR rtl-optimization/60851 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 52ec684fb6d0..04f08eb0416f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -41,6 +41,14 @@ proc check_compile {basename type contents args} { global tool verbose "check_compile tool: $tool for $basename" + # Save additional_sources to avoid compiling testsuite's sources + # against check_compile's source. + global additional_sources + if [info exists additional_sources] { + set tmp_additional_sources "$additional_sources" + set additional_sources "" + } + if { [llength $args] > 0 } { set options [list "additional_flags=[lindex $args 0]"] } else { @@ -86,6 +94,11 @@ proc check_compile {basename type contents args} { file delete $output } + # Restore additional_sources. + if [info exists additional_sources] { + set additional_sources "$tmp_additional_sources" + } + return [list $lines $scan_output] }