]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target-libpath.exp (set_gcc_exec_prefix_env_var, [...]): New procedures.
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 May 2014 18:40:20 +0000 (20:40 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 May 2014 18:40:20 +0000 (20:40 +0200)
* lib/target-libpath.exp (set_gcc_exec_prefix_env_var,
restore_gcc_exec_prefix_env_var): New procedures.
(set_ld_library_path_env_vars,
restore_ld_library_path_env_vars): Use them.
* lib/c-compat.exp: Load target-libpath.exp.
(compat-use-alt-compiler): Call restore_gcc_exec_prefix_env_var.
(compat-use-tst-compiler): Call set_gcc_exec_prefix_env_var.
* g++.dg/compat/compat.exp (compat-use-alt-compiler): Call
restore_gcc_exec_prefix_env_var.
* g++.dg/compat/struct-layout-1.exp (compat-use-alt-compiler):
Likewise.

From-SVN: r211093

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/compat/compat.exp
gcc/testsuite/g++.dg/compat/struct-layout-1.exp
gcc/testsuite/lib/c-compat.exp
gcc/testsuite/lib/target-libpath.exp

index 89cb55c1b00c18b5567bcf400cf81e7d16f6bae1..eea0c4f2cec54cbb4f1c94e838941c107f8267fa 100644 (file)
@@ -1,5 +1,17 @@
 2014-05-30  Jakub Jelinek  <jakub@redhat.com>
 
+       * lib/target-libpath.exp (set_gcc_exec_prefix_env_var,
+       restore_gcc_exec_prefix_env_var): New procedures.
+       (set_ld_library_path_env_vars,
+       restore_ld_library_path_env_vars): Use them.
+       * lib/c-compat.exp: Load target-libpath.exp.
+       (compat-use-alt-compiler): Call restore_gcc_exec_prefix_env_var.
+       (compat-use-tst-compiler): Call set_gcc_exec_prefix_env_var.
+       * g++.dg/compat/compat.exp (compat-use-alt-compiler): Call
+       restore_gcc_exec_prefix_env_var.
+       * g++.dg/compat/struct-layout-1.exp (compat-use-alt-compiler):
+       Likewise.
+
        * c-c++-common/asan/misalign-1.c: New test.
        * c-c++-common/asan/misalign-2.c: New test.
 
index 1a7cdb8396afd5c3c3850d258fe88df49cdf9b13..7fd77d7ed96683ed7f0faa2f31fbec3838c39ab7 100644 (file)
@@ -55,6 +55,7 @@ proc compat-use-alt-compiler { } {
        set ALWAYS_CXXFLAGS ""
        set ld_library_path $alt_ld_library_path
        set_ld_library_path_env_vars
+       restore_gcc_exec_prefix_env_var
     }
 }
 
index 13211c2fa17465d25c05b8440b7d2d4e8374b3d6..0beb59537239ba2f3b5203738910f7f6ac7c310d 100644 (file)
@@ -60,6 +60,7 @@ proc compat-use-alt-compiler { } {
        set ALWAYS_CXXFLAGS ""
        set ld_library_path $alt_ld_library_path
        set_ld_library_path_env_vars
+       restore_gcc_exec_prefix_env_var
     }
 }
 
index 95a1fb9d71f1ffbb6e550abe9681d917edf66d87..f5b461e473dd06256978996e504fb69fa4f2a001 100644 (file)
@@ -28,6 +28,7 @@ global compat_skip_list
 # compilers for compatibility tests.
 
 load_lib target-supports.exp
+load_lib target-libpath.exp
 
 #
 # compat-use-alt-compiler -- make the alternate compiler the default
@@ -47,6 +48,7 @@ proc compat-use-alt-compiler { } {
        if { $compat_alt_color == 0 } then {
            regsub -- "-fdiagnostics-color=never" $TEST_ALWAYS_FLAGS "" TEST_ALWAYS_FLAGS
        }
+       restore_gcc_exec_prefix_env_var
     }
 }
 
@@ -64,6 +66,7 @@ proc compat-use-tst-compiler { } {
     if { $compat_same_alt == 0 } then {
        set GCC_UNDER_TEST $compat_save_gcc_under_test
        set TEST_ALWAYS_FLAGS $compat_save_TEST_ALWAYS_FLAGS
+       set_gcc_exec_prefix_env_var
     }
 }
 
index 1891088c44a1768c4d929854c462a18c9a6f6538..175f3cd599e75ecfb398d862bcf749422e1e1291 100644 (file)
@@ -27,6 +27,21 @@ set orig_gcc_exec_prefix_saved 0
 set orig_gcc_exec_prefix_checked 0
 
 
+#######################################
+# proc set_gcc_exec_prefix_env_var { }
+#######################################
+
+proc set_gcc_exec_prefix_env_var { } {
+  global TEST_GCC_EXEC_PREFIX
+  global env
+
+  # Set GCC_EXEC_PREFIX for the compiler under test to pick up files not in
+  # the build tree from a specified location (normally the install tree).
+  if [info exists TEST_GCC_EXEC_PREFIX] {
+    setenv GCC_EXEC_PREFIX "$TEST_GCC_EXEC_PREFIX"
+  }
+}
+
 #######################################
 # proc set_ld_library_path_env_vars { }
 #######################################
@@ -49,7 +64,6 @@ proc set_ld_library_path_env_vars { } {
   global orig_ld_library_path_64
   global orig_dyld_library_path
   global orig_gcc_exec_prefix
-  global TEST_GCC_EXEC_PREFIX
   global env
 
   # Save the original GCC_EXEC_PREFIX.
@@ -61,11 +75,7 @@ proc set_ld_library_path_env_vars { } {
     set orig_gcc_exec_prefix_checked 1
   }
 
-  # Set GCC_EXEC_PREFIX for the compiler under test to pick up files not in
-  # the build tree from a specified location (normally the install tree).
-  if [info exists TEST_GCC_EXEC_PREFIX] {
-    setenv GCC_EXEC_PREFIX "$TEST_GCC_EXEC_PREFIX"
-  }
+  set_gcc_exec_prefix_env_var
 
   # Setting the ld library path causes trouble when testing cross-compilers.
   if { [is_remote target] } {
@@ -163,6 +173,22 @@ proc set_ld_library_path_env_vars { } {
   verbose -log "DYLD_LIBRARY_PATH=[getenv DYLD_LIBRARY_PATH]"
 }
 
+#######################################
+# proc restore_gcc_exec_prefix_env_var { }
+#######################################
+
+proc restore_gcc_exec_prefix_env_var { } {
+  global orig_gcc_exec_prefix_saved
+  global orig_gcc_exec_prefix
+  global env
+
+  if { $orig_gcc_exec_prefix_saved } {
+    setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
+  } elseif [info exists env(GCC_EXEC_PREFIX)] {
+    unsetenv GCC_EXEC_PREFIX
+  }
+}
+
 #######################################
 # proc restore_ld_library_path_env_vars { }
 #######################################
@@ -175,21 +201,15 @@ proc restore_ld_library_path_env_vars { } {
   global orig_ld_library_path_32_saved
   global orig_ld_library_path_64_saved
   global orig_dyld_library_path_saved
-  global orig_gcc_exec_prefix_saved
   global orig_ld_library_path
   global orig_ld_run_path
   global orig_shlib_path
   global orig_ld_library_path_32
   global orig_ld_library_path_64
   global orig_dyld_library_path
-  global orig_gcc_exec_prefix
   global env
 
-  if { $orig_gcc_exec_prefix_saved } {
-    setenv GCC_EXEC_PREFIX "$orig_gcc_exec_prefix"
-  } elseif [info exists env(GCC_EXEC_PREFIX)] {
-    unsetenv GCC_EXEC_PREFIX
-  }
+  restore_gcc_exec_prefix_env_var
 
   if { $orig_environment_saved == 0 } {
     return