Apppend $prop to et_prop_list only if needed
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Sep 2015 15:09:22 +0000 (15:09 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 4 Sep 2015 15:09:22 +0000 (15:09 +0000)
PR testsuite/67450
* lib/target-supports.exp (check_cached_effective_target):
Apppend $prop to et_prop_list only if needed.

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

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

index 9f692bd..bb4f975 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR testsuite/67450
+       * lib/target-supports.exp (check_cached_effective_target):
+       Apppend $prop to et_prop_list only if needed.
+
 2015-09-04  Marek Polacek  <polacek@redhat.com>
 
        PR sanitizer/67279
index aad45f9..5e17b26 100644 (file)
@@ -125,7 +125,10 @@ proc check_cached_effective_target { prop args } {
        verbose "check_cached_effective_target $prop: checking $target" 2
        set et_cache($prop,target) $target
        set et_cache($prop,value) [uplevel eval $args]
-       lappend et_prop_list $prop
+       if {![info exists et_prop_list]
+           || [lsearch $et_prop_list $prop] < 0} {
+           lappend et_prop_list $prop
+       }
        verbose "check_cached_effective_target cached list is now: $et_prop_list" 2
     }
     set value $et_cache($prop,value)