Patchwork testsuite tcl portability fix - avoid lreverse

login
register
mail settings
Submitter Jakub Jelinek
Date Jan. 30, 2013, 8:18 a.m.
Message ID <20130130081821.GX4385@tucnak.redhat.com>
Download mbox | patch
Permalink /patch/216778/
State New
Headers show

Comments

Jakub Jelinek - Jan. 30, 2013, 8:18 a.m.
Hi!

I've noticed
ERROR: (DejaGnu) proc "lreverse {{ASAN_OPTIONS 0}}" does not exist.                                                                                
errors when regtesting gcc 4.8 on RHEL 5, it seems lreverse has been added
to tcl only in version 8.5.

Fixed thusly, ok for trunk?

2013-01-30  Jakub Jelinek  <jakub@redhat.com>

	* lib/gcc-dg.exp (restore-target-env-var): Avoid using lreverse.


	Jakub
Mike Stump - Jan. 31, 2013, 9:35 p.m.
On Jan 30, 2013, at 12:18 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> I've noticed
> ERROR: (DejaGnu) proc "lreverse {{ASAN_OPTIONS 0}}" does not exist.                                                                                
> errors when regtesting gcc 4.8 on RHEL 5, it seems lreverse has been added
> to tcl only in version 8.5.

> Fixed thusly, ok for trunk?

Ok.

Patch

--- gcc/testsuite/lib/gcc-dg.exp.jj	2013-01-11 09:02:39.000000000 +0100
+++ gcc/testsuite/lib/gcc-dg.exp	2013-01-30 09:04:02.540243886 +0100
@@ -305,7 +305,9 @@  proc set-target-env-var { } {
 
 proc restore-target-env-var { } {
     upvar 1 saved_target_env_var saved_target_env_var
-    foreach env_var [lreverse $saved_target_env_var] {
+    for { set env_vari [llength $saved_target_env_var] } {
+          [incr env_vari -1] >= 0 } {} {
+	set env_var [lindex $saved_target_env_var $env_vari]
 	set var [lindex $env_var 0]
 	if [lindex $env_var 1] {
 	    setenv $var [lindex $env_var 2]