re PR testsuite/65116 (ERROR: can't read additional_sources: no such variable)
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Thu, 19 Feb 2015 19:57:30 +0000 (19:57 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Thu, 19 Feb 2015 19:57:30 +0000 (19:57 +0000)
Fix PR testsuite/65116

PR testsuite/65116
* lib/target-supports.exp (check_compile): Check whether
additional_sources is defined before using it.

From-SVN: r220822

gcc/testsuite/ChangeLog
gcc/testsuite/lib/target-supports.exp

index 65303b19ede7070ecab4d06923d9bc46e3df43f5..7514a0ae0c4023b0d154cc95115cd55ec375048f 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-19  Maxim Kuvyrkov  <maxim.kuvyrkov@linaro.org>
+
+       PR testsuite/65116
+       * lib/target-supports.exp (check_compile): Check whether
+       additional_sources is defined before using it.
+
 2015-02-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/65074
index 50a055d73289cb45dcaa4dd6f52ebb185148e89c..6b957dea4d4d5c6f0726faa9614b9f8a7be6e1c8 100644 (file)
@@ -44,8 +44,10 @@ proc check_compile {basename type contents args} {
     # Save additional_sources to avoid compiling testsuite's sources
     # against check_compile's source.
     global additional_sources
-    set tmp_additional_sources "$additional_sources"
-    set 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]"]
@@ -93,7 +95,9 @@ proc check_compile {basename type contents args} {
     }
 
     # Restore additional_sources.
-    set additional_sources "$tmp_additional_sources"
+    if [info exists additional_sources] {
+       set additional_sources "$tmp_additional_sources"
+    }
 
     return [list $lines $scan_output]
 }