Commit ac28df7e by Renlin Li Committed by Renlin Li

[Patch][libstdc++.exp] Update the usage of cached result.

This patch replaces the usage of cached results with a global dictionary.

Additionally, check_v3_target_namedlocale is updated to check on every variant.
Originally, it is only checked once.


gcc/libstdc++-v3/:
2018-11-16  Renlin Li  <renlin.li@arm.com>
	    Tejas Belagod  <tejas.belagod@arm.com>

	testsuite/lib/libstdc++.exp (check_v3_target_prop_cached): New proc.
	(check_v3_target): Use check_v3_target_prop_cached.


Co-Authored-By: Tejas Belagod <tejas.belagod@arm.com>

From-SVN: r266209
parent a0b48080
2018-11-16 Renlin Li <renlin.li@arm.com>
Tejas Belagod <tejas.belagod@arm.com>
testsuite/lib/libstdc++.exp (check_v3_target_prop_cached): New proc.
(check_v3_target): Use the check_v3_target_prop_cached.
2018-11-15 Jonathan Wakely <jwakely@redhat.com> 2018-11-15 Jonathan Wakely <jwakely@redhat.com>
* scripts/check_performance: Allow tests to choose a -std flag. * scripts/check_performance: Allow tests to choose a -std flag.
......
...@@ -688,31 +688,38 @@ proc v3-build_support { } { ...@@ -688,31 +688,38 @@ proc v3-build_support { } {
} }
} }
proc check_v3_target_fileio { } { # Implement an target check for property PROP by invoking
global et_fileio_saved # the Tcl command ARGS and seeing if it returns true.
global et_fileio_target_name
global tool
global srcdir
if { ![info exists et_fileio_target_name] } { proc check_v3_target_prop_cached { prop args } {
set et_fileio_target_name "" global et_cache
}
# If the target has changed since we set the cached value, clear it. set target [current_target_name]
set current_target [current_target_name] if {![info exists et_cache($prop,$target)]} {
if { $current_target != $et_fileio_target_name } { verbose "check_v3_target_prop_cached $prop: checking $target" 2
verbose "check_v3_target_fileio: `$et_fileio_target_name'" 2 if {[string is true -strict $args] || [string is false -strict $args]} {
set et_fileio_target_name $current_target error {check_v3_target_prop_cached condition already evaluated; did you pass [...] instead of the expected {...}?}
if [info exists et_fileio_saved] { } else {
verbose "check_v3_target_fileio: removing cached result" 2 set code [catch {uplevel eval $args} result]
unset et_fileio_saved if {$code != 0 && $code != 2} {
verbose "check_v3_target_prop_cached $prop: evaluation failed for $target" 2
return -code $code $result
}
set et_cache($prop,$target) $result
} }
} else {
verbose "check_v3_target_prop_cached $prop $target: using cached result" 2
} }
if [info exists et_fileio_saved] { set value $et_cache($prop,$target)
verbose "check_v3_target_fileio: using cached result" 2 verbose "check_v3_target_prop_cached $prop: returning $value for $target" 2
} else { return $value
set et_fileio_saved 0 }
proc check_v3_target_fileio { } {
return [check_v3_target_prop_cached et_fileio {
global tool
global srcdir
# Set up, compile, and execute a C++ test program that tries to use # Set up, compile, and execute a C++ test program that tries to use
# the file functions # the file functions
...@@ -766,41 +773,19 @@ proc check_v3_target_fileio { } { ...@@ -766,41 +773,19 @@ proc check_v3_target_fileio { } {
verbose "check_v3_target_fileio: status is <$status>" 2 verbose "check_v3_target_fileio: status is <$status>" 2
if { $status == "pass" } { if { $status == "pass" } {
set et_fileio_saved 1 return 1
} }
} else { } else {
verbose "check_v3_target_fileio: compilation failed" 2 verbose "check_v3_target_fileio: compilation failed" 2
} }
} return 0
return $et_fileio_saved }]
} }
# Eventually we want C90/C99 determining and switching from this. # Eventually we want C90/C99 determining and switching from this.
proc check_v3_target_c_std { } { proc check_v3_target_c_std { } {
global et_c_std_saved return [check_v3_target_prop_cached et_c_std {
global et_c_std_target_name global tool
global tool
if { ![info exists et_c_std_target_name] } {
set et_c_std_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_c_std_target_name } {
verbose "check_v3_target_c_std: `$et_c_std_target_name'" 2
set et_c_std_target_name $current_target
if [info exists et_c_std_saved] {
verbose "check_v3_target_c_std: removing cached result" 2
unset et_c_std_saved
}
}
if [info exists et_c_std_saved] {
verbose "check_v3_target_c_std: using cached result" 2
} else {
set et_c_std_saved 0
# Set up, compile, and execute a C++ test program that tries to use # Set up, compile, and execute a C++ test program that tries to use
# C99 functionality. # C99 functionality.
# For math bits, could use check_effective_target_c99_math. # For math bits, could use check_effective_target_c99_math.
...@@ -832,13 +817,13 @@ proc check_v3_target_c_std { } { ...@@ -832,13 +817,13 @@ proc check_v3_target_c_std { } {
verbose "check_v3_target_c_std: status is <$status>" 2 verbose "check_v3_target_c_std: status is <$status>" 2
if { $status == "pass" } { if { $status == "pass" } {
set et_c_std_saved 1 return 1
} }
} else { } else {
verbose "check_v3_target_c_std: compilation failed" 2 verbose "check_v3_target_c_std: compilation failed" 2
} }
} return 0
return $et_c_std_saved }]
} }
proc check_v3_target_sharedlib { } { proc check_v3_target_sharedlib { } {
...@@ -847,30 +832,8 @@ proc check_v3_target_sharedlib { } { ...@@ -847,30 +832,8 @@ proc check_v3_target_sharedlib { } {
} }
proc check_v3_target_time { } { proc check_v3_target_time { } {
global et_time_saved return [check_v3_target_prop_cached et_target_time {
global et_time_target_name global tool
global tool
if { ![info exists et_time_target_name] } {
set et_time_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_time_target_name } {
verbose "check_v3_target_time: `$et_time_target_name'" 2
set et_time_target_name $current_target
if [info exists et_time_saved] {
verbose "check_v3_target_time: removing cached result" 2
unset et_time_saved
}
}
if [info exists et_time_saved] {
verbose "check_v3_target_time: using cached result" 2
} else {
set et_time_saved 0
# Set up and compile a C++ test program that tries to use # Set up and compile a C++ test program that tries to use
# the time function # the time function
set src time[pid].cc set src time[pid].cc
...@@ -890,113 +853,87 @@ proc check_v3_target_time { } { ...@@ -890,113 +853,87 @@ proc check_v3_target_time { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, compilation succeeded. # No error message, compilation succeeded.
verbose "check_v3_target_time: compilation succeeded" 2 verbose "check_v3_target_time: compilation succeeded" 2
set et_time_saved 1 return 1
} else { } else {
verbose "check_v3_target_time: compilation failed" 2 verbose "check_v3_target_time: compilation failed" 2
return 0
} }
} }]
return $et_time_saved
} }
proc check_v3_target_namedlocale { args } { proc check_v3_target_namedlocale { args } {
global et_namedlocale set key "et_namedlocale $args"
global tool return [check_v3_target_prop_cached $key {
global tool
set et_namedlocale 0 # Set up, compile, and execute a C++ test program that tries to use
# the required named locale.
# Set up, compile, and execute a C++ test program that tries to use set exe nlocale[pid].x
# the required named locale. set src nlocale[pid].cc
set exe nlocale[pid].x
if ![file exists ./$exe] {
set src nlocale[pid].cc
set f [open $src "w"]
puts $f "#include <locale>"
puts $f "#include <cstdio>"
puts $f "#include <cstring>"
puts $f "using namespace std;"
puts $f "char *transform_locale(const char *name)"
puts $f "{"
puts $f " char *result = new char\[50\];"
puts $f " strcpy(result, name);"
puts $f "#if defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__"
puts $f " /* fall-through */"
puts $f "#else"
puts $f " if (strstr(result, \"ISO8859-15\")) {"
puts $f " strcat(result, \"@euro\");"
puts $f " }"
puts $f "#endif"
puts $f " return result;"
puts $f "}"
puts $f "int main (int argc, char** argv)"
puts $f "{"
puts $f " if (argc < 2)"
puts $f " {"
puts $f " printf(\"locale support test not supported\\n\");"
puts $f " return 1;"
puts $f " }"
puts $f " const char *namedloc = transform_locale(*(argv + 1));"
puts $f " try"
puts $f " {"
puts $f " locale((const char*)namedloc);"
puts $f " delete\[\] namedloc;"
puts $f " return 0;"
puts $f " }"
puts $f " catch(...)"
puts $f " {"
puts $f " printf(\"locale '%s' not supported\\n\", namedloc);"
puts $f " delete\[\] namedloc;"
puts $f " return 1;"
puts $f " }"
puts $f "}"
close $f
set lines [v3_target_compile $src $exe executable ""]
file delete $src
if ![string match "" $lines] {
verbose "check_v3_target_namedlocale: compilation failed" 2
return $et_namedlocale
}
# else No error message, compilation succeeded.
}
set result [${tool}_load "./$exe" "$args" ""]
set status [lindex $result 0]
verbose "check_v3_target_namedlocale <$args>: status is <$status>" 2 set f [open $src "w"]
puts $f "#include <locale>"
puts $f "#include <cstdio>"
puts $f "#include <cstring>"
puts $f "using namespace std;"
puts $f "char *transform_locale(const char *name)"
puts $f "{"
puts $f " char *result = new char\[50\];"
puts $f " strcpy(result, name);"
puts $f "#if defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__"
puts $f " /* fall-through */"
puts $f "#else"
puts $f " if (strstr(result, \"ISO8859-15\")) {"
puts $f " strcat(result, \"@euro\");"
puts $f " }"
puts $f "#endif"
puts $f " return result;"
puts $f "}"
puts $f "int main (int argc, char** argv)"
puts $f "{"
puts $f " if (argc < 2)"
puts $f " {"
puts $f " printf(\"locale support test not supported\\n\");"
puts $f " return 1;"
puts $f " }"
puts $f " const char *namedloc = transform_locale(*(argv + 1));"
puts $f " try"
puts $f " {"
puts $f " locale((const char*)namedloc);"
puts $f " delete\[\] namedloc;"
puts $f " return 0;"
puts $f " }"
puts $f " catch(...)"
puts $f " {"
puts $f " printf(\"locale '%s' not supported\\n\", namedloc);"
puts $f " delete\[\] namedloc;"
puts $f " return 1;"
puts $f " }"
puts $f "}"
close $f
if { $status == "pass" } { set lines [v3_target_compile $src $exe executable ""]
set et_namedlocale 1 file delete $src
}
return $et_namedlocale
}
proc check_v3_target_debug_mode { } { if ![string match "" $lines] {
global et_debug_mode verbose "check_v3_target_namedlocale: compilation failed" 2
global tool return 0
}
if { ![info exists et_debug_mode_target_name] } { set result [${tool}_load "./$exe" "$args" ""]
set et_debug_mode_target_name "" set status [lindex $result 0]
}
# If the target has changed since we set the cached value, clear it. verbose "check_v3_target_namedlocale <$args>: status is <$status>" 2
set current_target [current_target_name]
if { $current_target != $et_debug_mode_target_name } {
verbose "check_v3_target_debug_mode: `$et_debug_mode_target_name'" 2
set et_debug_mode_target_name $current_target
if [info exists et_debug_mode] {
verbose "check_v3_target_debug_mode: removing cached result" 2
unset et_debug_mode
}
}
if [info exists et_debug_mode] { if { $status == "pass" } {
verbose "check_v3_target_debug_mode: using cached result" 2 return 1
} else { }
set et_debug_mode 0 return 0
}]
}
proc check_v3_target_debug_mode { } {
return [check_v3_target_prop_cached et_debug_mode {
global tool
# Set up and preprocess a C++ test program that depends # Set up and preprocess a C++ test program that depends
# on debug mode activated. # on debug mode activated.
set src debug_mode[pid].cc set src debug_mode[pid].cc
...@@ -1012,37 +949,15 @@ proc check_v3_target_debug_mode { } { ...@@ -1012,37 +949,15 @@ proc check_v3_target_debug_mode { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_debug_mode 1 return 1
} }
} return 0
verbose "check_v3_target_debug_mode: $et_debug_mode" 2 }]
return $et_debug_mode
} }
proc check_v3_target_profile_mode { } { proc check_v3_target_profile_mode { } {
global et_profile_mode return [check_v3_target_prop_cached et_profile_mode {
global tool global tool
if { ![info exists et_profile_mode_target_name] } {
set et_profile_mode_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_profile_mode_target_name } {
verbose "check_v3_target_profile_mode: `$et_profile_mode_target_name'" 2
set et_profile_mode_target_name $current_target
if [info exists et_profile_mode] {
verbose "check_v3_target_profile_mode: removing cached result" 2
unset et_profile_mode
}
}
if [info exists et_profile_mode] {
verbose "check_v3_target_profile_mode: using cached result" 2
} else {
set et_profile_mode 0
# Set up and preprocess a C++ test program that depends # Set up and preprocess a C++ test program that depends
# on profile mode activated. # on profile mode activated.
set src profile_mode[pid].cc set src profile_mode[pid].cc
...@@ -1058,37 +973,15 @@ proc check_v3_target_profile_mode { } { ...@@ -1058,37 +973,15 @@ proc check_v3_target_profile_mode { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_profile_mode 1 return 1
} }
} return 0
verbose "check_v3_target_profile_mode: $et_profile_mode" 2 }]
return $et_profile_mode
} }
proc check_v3_target_normal_mode { } { proc check_v3_target_normal_mode { } {
global et_normal_mode return [check_v3_target_prop_cached et_normal_mode {
global tool global tool
if { ![info exists et_normal_mode_target_name] } {
set et_normal_mode_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_normal_mode_target_name } {
verbose "check_v3_target_normal_mode: `$et_normal_mode_target_name'" 2
set et_normal_mode_target_name $current_target
if [info exists et_normal_mode] {
verbose "check_v3_target_normal_mode: removing cached result" 2
unset et_normal_mode
}
}
if [info exists et_normal_mode] {
verbose "check_v3_target_normal_mode: using cached result" 2
} else {
set et_normal_mode 0
# Set up and compile a C++ test program that depends # Set up and compile a C++ test program that depends
# on normal mode activated. # on normal mode activated.
set src normal_mode[pid].cc set src normal_mode[pid].cc
...@@ -1107,37 +1000,15 @@ proc check_v3_target_normal_mode { } { ...@@ -1107,37 +1000,15 @@ proc check_v3_target_normal_mode { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, compilation succeeded. # No error message, compilation succeeded.
set et_normal_mode 1 return 1
} }
} return 0
verbose "check_v3_target_normal_mode: $et_normal_mode" 2 }]
return $et_normal_mode
} }
proc check_v3_target_normal_namespace { } { proc check_v3_target_normal_namespace { } {
global et_normal_namespace return [check_v3_target_prop_cached et_normal_namespace {
global tool global tool
if { ![info exists et_normal_namespace_target_name] } {
set et_normal_namespace_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_normal_namespace_target_name } {
verbose "check_v3_target_normal_namespace: `$et_normal_namespace_target_name'" 2
set et_normal_namespace_target_name $current_target
if [info exists et_normal_namespace] {
verbose "check_v3_target_normal_namespace: removing cached result" 2
unset et_normal_namespace
}
}
if [info exists et_normal_namespace] {
verbose "check_v3_target_normal_namespace: using cached result" 2
} else {
set et_normal_namespace 0
# Set up and compile a C++ test program that depends # Set up and compile a C++ test program that depends
# on normal std namespace. # on normal std namespace.
set src normal_namespace[pid].cc set src normal_namespace[pid].cc
...@@ -1154,76 +1025,28 @@ proc check_v3_target_normal_namespace { } { ...@@ -1154,76 +1025,28 @@ proc check_v3_target_normal_namespace { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, compilation succeeded. # No error message, compilation succeeded.
set et_normal_namespace 1 return 1
} }
} return 0
verbose "check_v3_target_normal_namespace: $et_normal_namespace" 2 }]
return $et_normal_namespace
} }
proc check_v3_target_parallel_mode { } { proc check_v3_target_parallel_mode { } {
global cxxflags return [check_v3_target_prop_cached et_parallel_mode {
global v3-libgomp global cxxflags
global et_parallel_mode global v3-libgomp
global tool
if { ![info exists et_parallel_mode_target_name] } {
set et_parallel_mode_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_parallel_mode_target_name } {
verbose "check_v3_target_parallel_mode: `$et_parallel_mode_target_name'" 2
set et_parallel_mode_target_name $current_target
if [info exists et_parallel_mode] {
verbose "check_v3_target_parallel_mode: removing cached result" 2
unset et_parallel_mode
}
}
if [info exists et_parallel_mode] {
verbose "check_v3_target_parallel_mode: using cached result" 2
} else {
set et_parallel_mode 0
# If 'make check-parallel' is running the test succeeds. # If 'make check-parallel' is running the test succeeds.
if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } { if { ${v3-libgomp} == 1 && [regexp "libgomp" $cxxflags] } {
set et_parallel_mode 1 return1 1
} }
} return 0
verbose "check_v3_target_parallel_mode: $et_parallel_mode" 2 }]
return $et_parallel_mode
} }
proc check_v3_target_cstdint { } { proc check_v3_target_cstdint { } {
global cxxflags return [check_v3_target_prop_cached et_cstdint {
global DEFAULT_CXXFLAGS global DEFAULT_CXXFLAGS
global et_cstdint global cxxflags
global tool
if { ![info exists et_cstdint_target_name] } {
set et_cstdint_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_cstdint_target_name } {
verbose "check_v3_target_cstdint: `$et_cstdint_target_name'" 2
set et_cstdint_target_name $current_target
if [info exists et_cstdint] {
verbose "check_v3_target_cstdint: removing cached result" 2
unset et_cstdint
}
}
if [info exists et_cstdint] {
verbose "check_v3_target_cstdint: using cached result" 2
} else {
set et_cstdint 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the C99 stdint facilities to be available. # on the C99 stdint facilities to be available.
set src cstdint[pid].cc set src cstdint[pid].cc
...@@ -1244,42 +1067,18 @@ proc check_v3_target_cstdint { } { ...@@ -1244,42 +1067,18 @@ proc check_v3_target_cstdint { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocess succeeded. # No error message, preprocess succeeded.
set et_cstdint 1 return 1
} else { } else {
verbose "check_v3_target_cstdint: compilation failed" 2 verbose "check_v3_target_cstdint: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_cstdint: $et_cstdint" 2
return $et_cstdint
} }
proc check_v3_target_cmath { } { proc check_v3_target_cmath { } {
global cxxflags return [check_v3_target_prop_cached et_c99_math {
global DEFAULT_CXXFLAGS global cxxflags
global et_c99_math global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_c99_math_target_name] } {
set et_c99_math_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_c99_math_target_name } {
verbose "check_v3_target_c99_math: `$et_c99_math_target_name'" 2
set et_c99_math_target_name $current_target
if [info exists et_c99_math] {
verbose "check_v3_target_c99_math: removing cached result" 2
unset et_c99_math
}
}
if [info exists et_c99_math] {
verbose "check_v3_target_c99_math: using cached result" 2
} else {
set et_c99_math 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the C99 math facilities to be available. # on the C99 math facilities to be available.
set src c99_math[pid].cc set src c99_math[pid].cc
...@@ -1300,41 +1099,18 @@ proc check_v3_target_cmath { } { ...@@ -1300,41 +1099,18 @@ proc check_v3_target_cmath { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocess succeeded. # No error message, preprocess succeeded.
set et_c99_math 1 return 1
} else { } else {
verbose "check_v3_target_c99_math: compilation failed" 2 verbose "check_v3_target_c99_math: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_c99_math: $et_c99_math" 2
return $et_c99_math
} }
proc check_v3_target_thread_fence { } { proc check_v3_target_thread_fence { } {
global cxxflags return [check_v3_target_prop_cached et_thread_fence {
global DEFAULT_CXXFLAGS global cxxflags
global et_thread_fence global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_thread_fence_target_name] } {
set et_thread_fence_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_thread_fence_target_name } {
verbose "check_v3_target_thread_fence: `$et_thread_fence_target_name'" 2
set et_thread_fence_target_name $current_target
if [info exists et_thread_fence] {
verbose "check_v3_target_thread_fence: removing cached result" 2
unset et_thread_fence
}
}
if [info exists et_thread_fence] {
verbose "check_v3_target_thread_fence: using cached result" 2
} else {
set et_thread_fence 0
# Set up and preprocess a C++11 test program that depends # Set up and preprocess a C++11 test program that depends
# on the thread fence to be available. # on the thread fence to be available.
...@@ -1356,41 +1132,18 @@ proc check_v3_target_thread_fence { } { ...@@ -1356,41 +1132,18 @@ proc check_v3_target_thread_fence { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, linking succeeded. # No error message, linking succeeded.
set et_thread_fence 1 return 1
} else { } else {
verbose "check_v3_target_thread_fence: compilation failed" 2 verbose "check_v3_target_thread_fence: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_thread_fence: $et_thread_fence" 2
return $et_thread_fence
} }
proc check_v3_target_atomic_builtins { } { proc check_v3_target_atomic_builtins { } {
global cxxflags return [check_v3_target_prop_cached et_atomic_builtins {
global DEFAULT_CXXFLAGS global cxxflags
global et_atomic_builtins global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_atomic_builtins_target_name] } {
set et_atomic_builtins_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_atomic_builtins_target_name } {
verbose "check_v3_target_atomic_builtins: `$et_atomic_builtins_target_name'" 2
set et_atomic_builtins_target_name $current_target
if [info exists et_atomic_builtins] {
verbose "check_v3_target_atomic_builtins: removing cached result" 2
unset et_atomic_builtins
}
}
if [info exists et_atomic_builtins] {
verbose "check_v3_target_atomic_builtins: using cached result" 2
} else {
set et_atomic_builtins 0
# Set up and preprocess a C++11 test program that depends # Set up and preprocess a C++11 test program that depends
# on the atomic builtin facilities to be available. # on the atomic builtin facilities to be available.
...@@ -1414,41 +1167,18 @@ proc check_v3_target_atomic_builtins { } { ...@@ -1414,41 +1167,18 @@ proc check_v3_target_atomic_builtins { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocess succeeded. # No error message, preprocess succeeded.
set et_atomic_builtins 1 return 1
} else { } else {
verbose "check_v3_target_atomic_builtins: compilation failed" 2 verbose "check_v3_target_atomic_builtins: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_atomic_builtins: $et_atomic_builtins" 2
return $et_atomic_builtins
} }
proc check_v3_target_gthreads { } { proc check_v3_target_gthreads { } {
global cxxflags return [check_v3_target_prop_cached et_gthreads {
global DEFAULT_CXXFLAGS global cxxflags
global et_gthreads global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_gthreads_target_name] } {
set et_gthreads_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_gthreads_target_name } {
verbose "check_v3_target_gthreads: `$et_gthreads_target_name'" 2
set et_gthreads_target_name $current_target
if [info exists et_gthreads] {
verbose "check_v3_target_gthreads: removing cached result" 2
unset et_gthreads
}
}
if [info exists et_gthreads] {
verbose "check_v3_target_gthreads: using cached result" 2
} else {
set et_gthreads 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the gthreads facilities to be available. # on the gthreads facilities to be available.
...@@ -1470,42 +1200,18 @@ proc check_v3_target_gthreads { } { ...@@ -1470,42 +1200,18 @@ proc check_v3_target_gthreads { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_gthreads 1 return 1
} else { } else {
verbose "check_v3_target_gthreads: compilation failed" 2 verbose "check_v3_target_gthreads: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_gthreads: $et_gthreads" 2
return $et_gthreads
} }
proc check_v3_target_gthreads_timed { } { proc check_v3_target_gthreads_timed { } {
global cxxflags return [check_v3_target_prop_cached et_gthreads_timed {
global DEFAULT_CXXFLAGS global cxxflags
global et_gthreads_timed global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_gthreads_timed_target_name] } {
set et_gthreads_timed_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_gthreads_timed_target_name } {
verbose "check_v3_target_gthreads_timed: `$et_gthreads_timed_target_name'" 2
set et_gthreads_timed_target_name $current_target
if [info exists et_gthreads_timed] {
verbose "check_v3_target_gthreads_timed: removing cached result" 2
unset et_gthreads_timed
}
}
if [info exists et_gthreads_timed] {
verbose "check_v3_target_gthreads_timed: using cached result" 2
} else {
set et_gthreads_timed 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the gthreads timed mutex facilities to be available. # on the gthreads timed mutex facilities to be available.
set src gthreads_timed[pid].cc set src gthreads_timed[pid].cc
...@@ -1529,43 +1235,18 @@ proc check_v3_target_gthreads_timed { } { ...@@ -1529,43 +1235,18 @@ proc check_v3_target_gthreads_timed { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_gthreads_timed 1 return 1
} else { } else {
verbose "check_v3_target_gthreads_timed: compilation failed" 2 verbose "check_v3_target_gthreads_timed: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_gthreads_timed: $et_gthreads_timed" 2
return $et_gthreads_timed
} }
proc check_v3_target_sleep { } { proc check_v3_target_sleep { } {
global cxxflags return [check_v3_target_prop_cached et_sleep {
global DEFAULT_CXXFLAGS global cxxflags
global et_sleep global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_sleep_target_name] } {
set et_sleep_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_sleep_target_name } {
verbose "check_v3_target_sleep: `$et_sleep_target_name'" 2
set et_sleep_target_name $current_target
if [info exists et_sleep] {
verbose "check_v3_target_sleep: removing cached result" 2
unset et_sleep
}
}
if [info exists et_sleep] {
verbose "check_v3_target_sleep: using cached result" 2
} else {
set et_sleep 0
# Set up and preprocess a C++11 test program that depends # Set up and preprocess a C++11 test program that depends
# on the sleep facilities to be available. # on the sleep facilities to be available.
set src sleep[pid].cc set src sleep[pid].cc
...@@ -1588,41 +1269,18 @@ proc check_v3_target_sleep { } { ...@@ -1588,41 +1269,18 @@ proc check_v3_target_sleep { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_sleep 1 return 1
} else { } else {
verbose "check_v3_target_sleep: compilation failed" 2 verbose "check_v3_target_sleep: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_sleep: $et_sleep" 2
return $et_sleep
} }
proc check_v3_target_sched_yield { } { proc check_v3_target_sched_yield { } {
global cxxflags return [check_v3_target_prop_cached et_sched_yield {
global DEFAULT_CXXFLAGS global cxxflags
global et_sched_yield global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_sched_yield_target_name] } {
set et_sched_yield_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_sched_yield_target_name } {
verbose "check_v3_target_sched_yield: `$et_sched_yield_target_name'" 2
set et_sched_yield_target_name $current_target
if [info exists et_sched_yield] {
verbose "check_v3_target_sched_yield: removing cached result" 2
unset et_sched_yield
}
}
if [info exists et_sched_yield] {
verbose "check_v3_target_sched_yield: using cached result" 2
} else {
set et_sched_yield 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the sched_yield facility to be available. # on the sched_yield facility to be available.
...@@ -1644,42 +1302,18 @@ proc check_v3_target_sched_yield { } { ...@@ -1644,42 +1302,18 @@ proc check_v3_target_sched_yield { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_sched_yield 1 return 1
} else { } else {
verbose "check_v3_target_sched_yield: compilation failed" 2 verbose "check_v3_target_sched_yield: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_sched_yield: $et_sched_yield" 2
return $et_sched_yield
} }
proc check_v3_target_string_conversions { } { proc check_v3_target_string_conversions { } {
global cxxflags return [check_v3_target_prop_cached et_string_conversions {
global DEFAULT_CXXFLAGS global cxxflags
global et_string_conversions global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_string_conversions_target_name] } {
set et_string_conversions_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_string_conversions_target_name } {
verbose "check_v3_target_string_conversions: `$et_string_conversions_target_name'" 2
set et_string_conversions_target_name $current_target
if [info exists et_string_conversions] {
verbose "check_v3_target_string_conversions: removing cached result" 2
unset et_string_conversions
}
}
if [info exists et_string_conversions] {
verbose "check_v3_target_string_conversions: using cached result" 2
} else {
set et_string_conversions 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on the string_conversions facilities to be available. # on the string_conversions facilities to be available.
set src string_conversions[pid].cc set src string_conversions[pid].cc
...@@ -1700,42 +1334,18 @@ proc check_v3_target_string_conversions { } { ...@@ -1700,42 +1334,18 @@ proc check_v3_target_string_conversions { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_string_conversions 1 return 1
} else { } else {
verbose "check_v3_target_string_conversions: compilation failed" 2 verbose "check_v3_target_string_conversions: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_string_conversions: $et_string_conversions" 2
return $et_string_conversions
} }
proc check_v3_target_swprintf { } { proc check_v3_target_swprintf { } {
global cxxflags return [check_v3_target_prop_cached et_swprintf {
global DEFAULT_CXXFLAGS global cxxflags
global et_swprintf global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_swprintf_target_name] } {
set et_swprintf_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_swprintf_target_name } {
verbose "check_v3_target_swprintf: `$et_swprintf_target_name'" 2
set et_swprintf_target_name $current_target
if [info exists et_swprintf] {
verbose "check_v3_target_swprintf: removing cached result" 2
unset et_swprintf
}
}
if [info exists et_swprintf] {
verbose "check_v3_target_swprintf: using cached result" 2
} else {
set et_swprintf 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on a standard swprintf function to be available. # on a standard swprintf function to be available.
set src swprintf[pid].cc set src swprintf[pid].cc
...@@ -1756,42 +1366,18 @@ proc check_v3_target_swprintf { } { ...@@ -1756,42 +1366,18 @@ proc check_v3_target_swprintf { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_swprintf 1 return 1
} else { } else {
verbose "check_v3_target_swprintf: compilation failed" 2 verbose "check_v3_target_swprintf: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_swprintf: $et_swprintf" 2
return $et_swprintf
} }
proc check_v3_target_binary_io { } { proc check_v3_target_binary_io { } {
global cxxflags return [check_v3_target_prop_cached et_binary_io {
global DEFAULT_CXXFLAGS global cxxflags
global et_binary_io global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_binary_io_target_name] } {
set et_binary_io_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_binary_io_target_name } {
verbose "check_v3_target_binary_io: `$et_binary_io_target_name'" 2
set et_binary_io_target_name $current_target
if [info exists et_binary_io] {
verbose "check_v3_target_binary_io: removing cached result" 2
unset et_binary_io
}
}
if [info exists et_binary_io] {
verbose "check_v3_target_binary_io: using cached result" 2
} else {
set et_binary_io 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on text and binary I/O being the same. # on text and binary I/O being the same.
set src binary_io[pid].cc set src binary_io[pid].cc
...@@ -1812,42 +1398,18 @@ proc check_v3_target_binary_io { } { ...@@ -1812,42 +1398,18 @@ proc check_v3_target_binary_io { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_binary_io 1 return 1
} else { } else {
verbose "check_v3_target_binary_io: compilation failed" 2 verbose "check_v3_target_binary_io: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_binary_io: $et_binary_io" 2
return $et_binary_io
} }
proc check_v3_target_nprocs { } { proc check_v3_target_nprocs { } {
global cxxflags return [check_v3_target_prop_cached et_nprocs {
global DEFAULT_CXXFLAGS global cxxflags
global et_nprocs global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_nprocs_target_name] } {
set et_nprocs_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_nprocs_target_name } {
verbose "check_v3_target_nprocs: `$et_nprocs_target_name'" 2
set et_nprocs_target_name $current_target
if [info exists et_nprocs] {
verbose "check_v3_target_nprocs: removing cached result" 2
unset et_nprocs
}
}
if [info exists et_nprocs] {
verbose "check_v3_target_nprocs: using cached result" 2
} else {
set et_nprocs 0
# Set up and preprocess a C++0x test program that depends # Set up and preprocess a C++0x test program that depends
# on either get_nprocs or sysconf to be available. # on either get_nprocs or sysconf to be available.
set src nprocs[pid].cc set src nprocs[pid].cc
...@@ -1873,27 +1435,18 @@ proc check_v3_target_nprocs { } { ...@@ -1873,27 +1435,18 @@ proc check_v3_target_nprocs { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocess succeeded. # No error message, preprocess succeeded.
set et_nprocs 1 return 1
} else { } else {
verbose "check_v3_target_nprocs: compilation failed" 2 verbose "check_v3_target_nprocs: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_nprocs: $et_nprocs" 2
return $et_nprocs
} }
proc check_v3_target_static_libstdcxx { } { proc check_v3_target_static_libstdcxx { } {
global cxxflags return [check_v3_target_prop_cached et_static_libstdcxx {
global DEFAULT_CXXFLAGS global cxxflags
global et_static_libstdcxx global DEFAULT_CXXFLAGS
global tool
if [info exists et_static_libstdcxx] {
verbose "check_v3_target_static_libstdcxx: using cached result" 2
} else {
set et_static_libstdcxx 0
# Set up and link a C++0x test program that depends # Set up and link a C++0x test program that depends
# on static linking # on static linking
set src static-maybe[pid].cc set src static-maybe[pid].cc
...@@ -1916,42 +1469,18 @@ proc check_v3_target_static_libstdcxx { } { ...@@ -1916,42 +1469,18 @@ proc check_v3_target_static_libstdcxx { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, link succeeded. # No error message, link succeeded.
set et_static_libstdcxx 1 return 1
} else { } else {
verbose "check_v3_target_static_libstdcxx: compilation failed" 2 verbose "check_v3_target_static_libstdcxx: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_static_libstdcxx: $et_static_libstdcxx" 2
return $et_static_libstdcxx
} }
proc check_v3_target_little_endian { } { proc check_v3_target_little_endian { } {
global cxxflags return [check_v3_target_prop_cached et_little_endian {
global DEFAULT_CXXFLAGS global cxxflags
global et_little_endian global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_little_endian_target_name] } {
set et_little_endian_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_little_endian_target_name } {
verbose "check_v3_target_little_endian: `$et_little_endian_target_name'" 2
set et_little_endian_target_name $current_target
if [info exists et_little_endian] {
verbose "check_v3_target_little_endian: removing cached result" 2
unset et_little_endian
}
}
if [info exists et_little_endian] {
verbose "check_v3_target_little_endian: using cached result" 2
} else {
set et_little_endian 0
set src little_endian[pid].cc set src little_endian[pid].cc
set f [open $src "w"] set f [open $src "w"]
...@@ -1969,43 +1498,20 @@ proc check_v3_target_little_endian { } { ...@@ -1969,43 +1498,20 @@ proc check_v3_target_little_endian { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_little_endian 1 return 1
} else { } else {
verbose "check_v3_target_little_endian: compilation failed" 2 verbose "check_v3_target_little_endian: compilation failed" 2
return 0
} }
} }]
verbose "check_v3_target_little_endian: $et_little_endian" 2
return $et_little_endian
} }
# Return 1 if the Filesystem TS is supported, 0 otherwise. # Return 1 if the Filesystem TS is supported, 0 otherwise.
# Cache the result. # Cache the result.
proc check_v3_target_filesystem_ts { } { proc check_v3_target_filesystem_ts { } {
global cxxflags return [check_v3_target_prop_cached et_filesystem_ts {
global DEFAULT_CXXFLAGS global cxxflags
global et_filesystem_ts global DEFAULT_CXXFLAGS
global tool
if { ![info exists et_filesystem_ts_target_name] } {
set et_filesystem_ts_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_filesystem_ts_target_name } {
verbose "check_v3_target_filesystem_ts: `$et_filesystem_ts_target_name'" 2
set et_filesystem_ts_target_name $current_target
if [info exists et_filesystem_ts] {
verbose "check_v3_target_filesystem_ts: removing cached result" 2
unset et_filesystem_ts
}
}
if [info exists et_filesystem_ts] {
verbose "check_v3_target_filesystem_ts: using cached result" 2
} else {
set et_filesystem_ts 0
# Set up and preprocess a C++ test program that depends # Set up and preprocess a C++ test program that depends
# on the Filesystem TS feature-test macro being defined. # on the Filesystem TS feature-test macro being defined.
set src filesystem_ts[pid].cc set src filesystem_ts[pid].cc
...@@ -2026,11 +1532,10 @@ proc check_v3_target_filesystem_ts { } { ...@@ -2026,11 +1532,10 @@ proc check_v3_target_filesystem_ts { } {
if [string match "" $lines] { if [string match "" $lines] {
# No error message, preprocessing succeeded. # No error message, preprocessing succeeded.
set et_filesystem_ts 1 return 1
} }
} return 0
verbose "check_v3_target_filesystem_ts: $et_filesystem_ts" 2 }]
return $et_filesystem_ts
} }
# Return 1 if the "cxx11" ABI is in use using the current flags, 0 otherwise. # Return 1 if the "cxx11" ABI is in use using the current flags, 0 otherwise.
......
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