summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/lib
diff options
context:
space:
mode:
authorfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-26 20:29:01 +0000
committerfdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-26 20:29:01 +0000
commit839f647191892bcaf51f7aab14ee75e1b84679b8 (patch)
treec2c18e2d66792407c4ffaf4014b81dc35d76f798 /libstdc++-v3/testsuite/lib
parent037176b69ce4cdcb68aaab0bf66c679bcb489dd3 (diff)
downloadgcc-839f647191892bcaf51f7aab14ee75e1b84679b8.tar.gz
2010-11-26 François Dumont <francois.cppdevs@free.fr>
* testsuite/lib/libstdc++.exp [check_v3_target_debug_mode]: Use remote_file delete for generated exe. [check_v3_target_profile_mode] Add. * testsuite/lib/dg-options.exp [dg-require-profile-mode]: Add * testsuite/ext/profile/mh.cc, profiler_algos.cc, all.cc: Use dg-require-profile-mode, remove explicit _GLIBCXX_PROFILE definition. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167188 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/lib')
-rw-r--r--libstdc++-v3/testsuite/lib/dg-options.exp9
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp52
2 files changed, 60 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index e8d7f3452ae..b75f516c41f 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -35,6 +35,15 @@ proc dg-require-debug-mode { args } {
return
}
+proc dg-require-profile-mode { args } {
+ if { ![ check_v3_target_profile_mode ] } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ return
+ }
+ return
+}
+
proc dg-require-normal-mode { args } {
if { ![ check_v3_target_normal_mode ] } {
upvar dg-do-what dg-do-what
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 36b6e864f10..d94abfd8b60 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -935,7 +935,7 @@ proc check_v3_target_debug_mode { } {
if [string match "" $lines] {
# No error message, compilation succeeded.
- file delete $exe
+ remote_file build delete $exe
set et_debug_mode 1
}
}
@@ -943,6 +943,56 @@ proc check_v3_target_debug_mode { } {
return $et_debug_mode
}
+proc check_v3_target_profile_mode { } {
+ global et_profile_mode
+ 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 compile a C++ test program that depends
+ # on profile mode activated.
+ set src profile_mode[pid].cc
+ set exe profile_mode[pid].exe
+
+ set f [open $src "w"]
+ puts $f "#ifndef _GLIBCXX_PROFILE"
+ puts $f "# error No profile mode"
+ puts $f "#endif"
+ puts $f "int main()"
+ puts $f "{ return 0; }"
+ close $f
+
+ set lines [v3_target_compile $src $exe executable ""]
+ file delete $src
+
+ if [string match "" $lines] {
+ # No error message, compilation succeeded.
+ remote_file build delete $exe
+ set et_profile_mode 1
+ }
+ }
+ verbose "check_v3_target_profile_mode: $et_profile_mode" 2
+ return $et_profile_mode
+}
+
proc check_v3_target_normal_mode { } {
global et_normal_mode
global tool