aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2008-02-04 22:36:26 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2008-02-04 22:36:26 +0000
commitca8b555b1d69cf4e1ed7f637113abd337574cbef (patch)
tree5d245c2e555de856384e94d05d7872e24fda0b56 /gcc
parentba6e57ba62158ff6fb72948557eef72530fcad18 (diff)
downloadgcc-ca8b555b1d69cf4e1ed7f637113abd337574cbef.zip
gcc-ca8b555b1d69cf4e1ed7f637113abd337574cbef.tar.gz
gcc-ca8b555b1d69cf4e1ed7f637113abd337574cbef.tar.bz2
target-supports.exp (check_effective_target_hard_float): Only use the preprocessor tests for mips*-*-* and xtensa-*-*.
* lib/target-supports.exp (check_effective_target_hard_float): Only use the preprocessor tests for mips*-*-* and xtensa-*-*. For all other targets, grep for a call insn in the rtl expand dump for an add of two doubles. (target_compile): Support generating rtl dumps as output. From-SVN: r132102
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/lib/target-supports.exp39
2 files changed, 38 insertions, 9 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d1b8a5d..6034810 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2008-02-04 Hans-Peter Nilsson <hp@axis.com>
+
+ * lib/target-supports.exp (check_effective_target_hard_float): Only
+ use the preprocessor tests for mips*-*-* and xtensa-*-*. For all
+ other targets, grep for a call insn in the rtl expand dump for an
+ add of two doubles.
+ (target_compile): Support generating rtl dumps as output.
+
2008-02-04 Richard Guenther <rguenther@suse.de>
PR middle-end/33631
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index eacd831..1286a98 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -44,18 +44,32 @@ proc check_compile {basename type contents args} {
"*// C++*" { set src ${basename}[pid].cc }
default { set src ${basename}[pid].c }
}
- switch $type {
+ set compile_type $type
+ switch -glob $type {
assembly { set output ${basename}[pid].s }
object { set output ${basename}[pid].o }
executable { set output ${basename}[pid].exe }
+ "rtl-*" {
+ set output ${basename}[pid].s
+ lappend options "additional_flags=-fdump-$type"
+ set compile_type assembly
+ }
}
set f [open $src "w"]
puts $f $contents
close $f
- set lines [${tool}_target_compile $src $output $type "$options"]
+ set lines [${tool}_target_compile $src $output $compile_type "$options"]
file delete $src
- return [list $lines $output]
+ set scan_output $output
+ # Don't try folding this into the switch above; calling "glob" before the
+ # file is created won't work.
+ if [regexp "rtl-(.*)" $type dummy rtl_type] {
+ set scan_output "[glob $src.\[0-9\]\[0-9\]\[0-9\]r.$rtl_type]"
+ file delete $output
+ }
+
+ return [list $lines $scan_output]
}
proc current_target_name { } {
@@ -565,12 +579,19 @@ proc check_effective_target_mpaired_single { } {
# Return true if the target has access to FPU instructions.
proc check_effective_target_hard_float { } {
- return [check_no_compiler_messages hard_float assembly {
- #if ((defined __mips \
- && (defined __mips_soft_float || defined __mips16)) \
- || (defined __xtensa__ && defined __XTENSA_SOFT_FLOAT__))
- #error FOO
- #endif
+ if { [istarget mips*-*-*] || [istarget xtensa-*-*] } {
+ return [check_no_compiler_messages hard_float assembly {
+ #if ((defined __mips \
+ && (defined __mips_soft_float || defined __mips16)) \
+ || (defined __xtensa__ && defined __XTENSA_SOFT_FLOAT__))
+ #error FOO
+ #endif
+ }]
+ }
+
+ # The generic test equates hard_float with "no call for adding doubles".
+ return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand {
+ double a (double b, double c) { return b + c; }
}]
}