Commit dfda198c by Christophe Lyon Committed by Christophe Lyon

[testsuite] Clean up effective_target cache.

2015-09-02  Christophe Lyon  <christophe.lyon@linaro.org>

	* lib/target-supports.exp (clear_effective_target_cache): New.
	(check_cached_effective_target): Update et_prop_list.
	* lib/asan-dg.exp (asan_finish): Call clear_effective_target_cache.
	* g++.dg/compat/compat.exp: Likewise.
	* g++.dg/compat/struct-layout-1.exp: Likewise.
	* lib/asan-dg.exp: Likewise.
	* lib/atomic-dg.exp: Likewise.
	* lib/cilk-plus-dg.exp: Likewise.
	* lib/clearcap.exp: Likewise.
	* lib/mpx-dg.exp: Likewise.
	* lib/tsan-dg.exp: Likewise.
	* lib/ubsan-dg.exp: Likewise.

From-SVN: r227401
parent d8e19f31
2015-09-02 Christophe Lyon <christophe.lyon@linaro.org>
* lib/target-supports.exp (clear_effective_target_cache): New.
(check_cached_effective_target): Update et_prop_list.
* lib/asan-dg.exp (asan_finish): Call clear_effective_target_cache.
* g++.dg/compat/compat.exp: Likewise.
* g++.dg/compat/struct-layout-1.exp: Likewise.
* lib/asan-dg.exp: Likewise.
* lib/atomic-dg.exp: Likewise.
* lib/cilk-plus-dg.exp: Likewise.
* lib/clearcap.exp: Likewise.
* lib/mpx-dg.exp: Likewise.
* lib/tsan-dg.exp: Likewise.
* lib/ubsan-dg.exp: Likewise.
2015-09-01 Kenneth Zadeck <zadeck@naturalbridge.com> 2015-09-01 Kenneth Zadeck <zadeck@naturalbridge.com>
* gcc.c-torture/execute/ieee/20000320-1.c Fixed misplaced test case. * gcc.c-torture/execute/ieee/20000320-1.c Fixed misplaced test case.
......
...@@ -78,6 +78,7 @@ proc compat-use-tst-compiler { } { ...@@ -78,6 +78,7 @@ proc compat-use-tst-compiler { } {
set ALWAYS_CXXFLAGS $save_always_cxxflags set ALWAYS_CXXFLAGS $save_always_cxxflags
set ld_library_path $save_ld_library_path set ld_library_path $save_ld_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
clear_effective_target_cache
} }
} }
......
...@@ -61,6 +61,7 @@ proc compat-use-alt-compiler { } { ...@@ -61,6 +61,7 @@ proc compat-use-alt-compiler { } {
set ld_library_path $alt_ld_library_path set ld_library_path $alt_ld_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
restore_gcc_exec_prefix_env_var restore_gcc_exec_prefix_env_var
clear_effective_target_cache
} }
} }
......
...@@ -138,6 +138,7 @@ proc asan_finish { args } { ...@@ -138,6 +138,7 @@ proc asan_finish { args } {
} }
set ld_library_path $asan_saved_library_path set ld_library_path $asan_saved_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
clear_effective_target_cache
} }
# Symbolize lines like # Symbolize lines like
......
...@@ -101,4 +101,5 @@ proc atomic_finish { args } { ...@@ -101,4 +101,5 @@ proc atomic_finish { args } {
} else { } else {
unset TEST_ALWAYS_FLAGS unset TEST_ALWAYS_FLAGS
} }
clear_effective_target_cache
} }
...@@ -101,4 +101,5 @@ proc cilkplus_finish { args } { ...@@ -101,4 +101,5 @@ proc cilkplus_finish { args } {
} else { } else {
unset TEST_ALWAYS_FLAGS unset TEST_ALWAYS_FLAGS
} }
clear_effective_target_cache
} }
...@@ -55,4 +55,5 @@ proc clearcap-finish { args } { ...@@ -55,4 +55,5 @@ proc clearcap-finish { args } {
} else { } else {
unset TEST_ALWAYS_FLAGS unset TEST_ALWAYS_FLAGS
} }
clear_effective_target_cache
} }
...@@ -142,4 +142,5 @@ proc mpx_finish { args } { ...@@ -142,4 +142,5 @@ proc mpx_finish { args } {
} }
set ld_library_path $mpx_saved_library_path set ld_library_path $mpx_saved_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
clear_effective_target_cache
} }
...@@ -117,6 +117,7 @@ proc current_target_name { } { ...@@ -117,6 +117,7 @@ proc current_target_name { } {
proc check_cached_effective_target { prop args } { proc check_cached_effective_target { prop args } {
global et_cache global et_cache
global et_prop_list
set target [current_target_name] set target [current_target_name]
if {![info exists et_cache($prop,target)] if {![info exists et_cache($prop,target)]
...@@ -124,12 +125,37 @@ proc check_cached_effective_target { prop args } { ...@@ -124,12 +125,37 @@ proc check_cached_effective_target { prop args } {
verbose "check_cached_effective_target $prop: checking $target" 2 verbose "check_cached_effective_target $prop: checking $target" 2
set et_cache($prop,target) $target set et_cache($prop,target) $target
set et_cache($prop,value) [uplevel eval $args] set et_cache($prop,value) [uplevel eval $args]
lappend et_prop_list $prop
verbose "check_cached_effective_target cached list is now: $et_prop_list" 2
} }
set value $et_cache($prop,value) set value $et_cache($prop,value)
verbose "check_cached_effective_target $prop: returning $value for $target" 2 verbose "check_cached_effective_target $prop: returning $value for $target" 2
return $value return $value
} }
# Clear effective-target cache. This is useful after testing
# effective-target features and overriding TEST_ALWAYS_FLAGS and/or
# ALWAYS_CXXFLAGS.
# If one changes ALWAYS_CXXFLAGS or TEST_ALWAYS_FLAGS then they should
# do a clear_effective_target_cache at the end as the target cache can
# make decisions based upon the flags, and those decisions need to be
# redone when the flags change. An example of this is the
# asan_init/asan_finish pair.
proc clear_effective_target_cache { } {
global et_cache
global et_prop_list
if {[info exists et_prop_list]} {
verbose "clear_effective_target_cache: $et_prop_list" 2
foreach prop $et_prop_list {
unset et_cache($prop,value)
unset et_cache($prop,target)
}
unset et_prop_list
}
}
# Like check_compile, but delete the output file and return true if the # Like check_compile, but delete the output file and return true if the
# compiler printed no messages. # compiler printed no messages.
proc check_no_compiler_messages_nocache {args} { proc check_no_compiler_messages_nocache {args} {
......
...@@ -149,4 +149,5 @@ proc tsan_finish { args } { ...@@ -149,4 +149,5 @@ proc tsan_finish { args } {
} }
set ld_library_path $tsan_saved_library_path set ld_library_path $tsan_saved_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
clear_effective_target_cache
} }
...@@ -121,4 +121,5 @@ proc ubsan_finish { args } { ...@@ -121,4 +121,5 @@ proc ubsan_finish { args } {
} }
set ld_library_path $ubsan_saved_library_path set ld_library_path $ubsan_saved_library_path
set_ld_library_path_env_vars set_ld_library_path_env_vars
clear_effective_target_cache
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment