OSDN Git Service

* lib/target-supports.exp (check_effective_target_fortran_large_real,
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Oct 2005 21:45:50 +0000 (21:45 +0000)
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Oct 2005 21:45:50 +0000 (21:45 +0000)
check_effective_target_fortran_large_int): Replace cached result
when target changes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104959 138bc75d-0d04-0410-961f-82ee72b054a4

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

index bc53511..dd5d173 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-04  Janis Johnson  <janis187@us.ibm.com>
+
+       * lib/target-supports.exp (check_effective_target_fortran_large_real,
+       check_effective_target_fortran_large_int): Replace cached result
+       when target changes.
+
 2005-10-04  Devang Patel  <dpatel@apple.com>
 
        * gcc.dg/i386-sse-vect-types.c: New.
 2005-10-04  Devang Patel  <dpatel@apple.com>
 
        * gcc.dg/i386-sse-vect-types.c: New.
index 6cbbf14..b98e3ce 100644 (file)
@@ -411,12 +411,30 @@ proc check_named_sections_available { } {
 }
 
 # Return 1 if the target supports Fortran real kinds larger than real(8),
 }
 
 # Return 1 if the target supports Fortran real kinds larger than real(8),
-# 0 otherwise.  Cache the result.
+# 0 otherwise.
+#
+# When the target name changes, replace the cached result.
 
 proc check_effective_target_fortran_large_real { } {
     global et_fortran_large_real_saved
 
 proc check_effective_target_fortran_large_real { } {
     global et_fortran_large_real_saved
+    global et_fortran_large_real_target_name
     global tool
 
     global tool
 
+    if { ![info exists et_fortran_large_real_target_name] } {
+       set et_fortran_large_real_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_fortran_large_real_target_name } {
+       verbose "check_effective_target_fortran_large_real: `$et_fortran_large_real_target_name' `$current_target'" 2
+       set et_fortran_large_real_target_name $current_target
+       if [info exists et_fortran_large_real_saved] {
+           verbose "check_effective_target_fortran_large_real: removing cached result" 2
+           unset et_fortran_large_real_saved
+       }
+    }
+
     if [info exists et_fortran_large_real_saved] {
        verbose "check_effective_target_fortran_large_real returning saved $et_fortran_large_real_saved" 2
     } else {
     if [info exists et_fortran_large_real_saved] {
        verbose "check_effective_target_fortran_large_real returning saved $et_fortran_large_real_saved" 2
     } else {
@@ -449,12 +467,30 @@ proc check_effective_target_fortran_large_real { } {
 }
 
 # Return 1 if the target supports Fortran integer kinds larger than
 }
 
 # Return 1 if the target supports Fortran integer kinds larger than
-# integer(8), 0 otherwise.  Cache the result.
+# integer(8), 0 otherwise.
+#
+# When the target name changes, replace the cached result.
 
 proc check_effective_target_fortran_large_int { } {
     global et_fortran_large_int_saved
 
 proc check_effective_target_fortran_large_int { } {
     global et_fortran_large_int_saved
+    global et_fortran_large_int_target_name
     global tool
 
     global tool
 
+    if { ![info exists et_fortran_large_int_target_name] } {
+       set et_fortran_large_int_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_fortran_large_int_target_name } {
+       verbose "check_effective_target_fortran_large_int: `$et_fortran_large_int_target_name' `$current_target'" 2
+       set et_fortran_large_int_target_name $current_target
+       if [info exists et_fortran_large_int_saved] {
+           verbose "check_effective_target_fortran_large_int: removing cached result" 2
+           unset et_fortran_large_int_saved
+       }
+    }
+
     if [info exists et_fortran_large_int_saved] {
        verbose "check_effective_target_fortran_large_int returning saved $et_fortran_large_int_saved" 2
     } else {
     if [info exists et_fortran_large_int_saved] {
        verbose "check_effective_target_fortran_large_int returning saved $et_fortran_large_int_saved" 2
     } else {