re PR testsuite/25318 (g++.dg/other/pr22003.C (test for excess errors) fails)

PR testsuite/25318
	* lib/target-supports.exp (check_effective_target_freorder):
	Check to see if target supports -freorder-blocks-and-partition.
	* g++.dg/other/pr22003.C: Use "dg-require-effective-target freorder"
	instead of "dg-require-named-sections".

From-SVN: r110405
This commit is contained in:
Steve Ellcey 2006-01-30 17:06:16 +00:00 committed by Steve Ellcey
parent 6bb862cc97
commit 3b1a6677a7
3 changed files with 44 additions and 3 deletions

View file

@ -1,3 +1,11 @@
2006-01-30 Steve Ellcey <sje@cup.hp.com>
PR testsuite/25318
* lib/target-supports.exp (check_effective_target_freorder):
Check to see if target supports -freorder-blocks-and-partition.
* g++.dg/other/pr22003.C: Use "dg-require-effective-target freorder"
instead of "dg-require-named-sections".
2006-01-30 J"orn Rennecke <joern.rennecke@st.com>
PR target/14798:

View file

@ -1,8 +1,6 @@
/* PR rtl-optimization/22003 */
/* { dg-do compile } */
/* -freorder-blocks-and-partition is not supported on machines */
/* that do not support named sections. */
/* { dg-require-named-sections "" } */
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -fno-exceptions -freorder-blocks-and-partition" } */
struct c1

View file

@ -503,6 +503,41 @@ proc check_effective_target_fopenmp {} {
return $et_fopenmp_saved
}
# Return 1 if compilation with -freorder-blocks-and-partition is error-free
# for trivial code, 0 otherwise.
proc check_effective_target_freorder {} {
global et_freorder_saved
global et_freorder_target_name
if { ![info exists et_freorder_target_name] } {
set et_freorder_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_freorder_target_name } {
verbose "check_effective_target_freorder: `$et_freorder_target_name'" 2
set et_freorder_target_name $current_target
if [info exists et_freorder_saved] {
verbose "check_effective_target_freorder: removing cached result" 2
unset et_freorder_saved
}
}
if [info exists et_freorder_saved] {
verbose "check_effective_target_freorder: using cached result" 2
} else {
verbose "check_effective_target_freorder: compiling source" 2
set et_freorder_saved [string match "" [get_compiler_messages freorder object {
void foo (void) { }
} "-freorder-blocks-and-partition"]]
}
verbose "check_effective_target_freorder: returning $et_freorder_saved" 2
return $et_freorder_saved
}
# Return 1 if -fpic and -fPIC are supported, as in no warnings or errors
# emitted, 0 otherwise. Whether a shared library can actually be built is
# out of scope for this test.