diff options
author | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 00:09:27 +0000 |
---|---|---|
committer | janis <janis@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-01-17 00:09:27 +0000 |
commit | 73492ab6218406ea044270438c137344e2466fb8 (patch) | |
tree | cd1bcd4b60463425318e6505d696026fa0c50f91 /gcc/testsuite/lib | |
parent | e3acaece1fd0ca4151ad42271106d970325b29d8 (diff) | |
download | gcc-73492ab6218406ea044270438c137344e2466fb8.tar.gz |
* lib/target-supports.exp (check_effective_target_dfp_nocache,
check_effective_target_dfprt_nocache): New.
(check_effective_target_dfp): Use check_effective_target_dfp_nocache.
(check_effective_target_dfprt): New.
* lib/c-compat.exp (check_dfp): Remove.
(compat_dfp_setup): Use check_effective_target_dfprt_nocache.
* gcc.dg/dfp/dfp.exp: Compile, execute, or skip tests based on
level of support for decimal float.
* gcc.dg/dfp/call-by-value.c, cast.c, compare-eq-const.c,
compare-eq-d128.c, compare-eq-d32.c, compare-eq-d64.c,
compare-eq-dfp.c, compare-rel-const.c, compare-rel-d128.c,
compare-rel-d32.c, compare-rel-d64.c, compare-rel-dfp.c,
convert-bfp.c, convert-bfp-fold.c, convert-complex.c, convert-dfp.c,
convert-dfp-fold.c, convert-dfp-round.c, convert-int-fold.c,
convert-int-saturate.c, func-array.c, func-mixed.c, func-scalar.c,
func-struct.c, func-vararg-dfp.c, func-vararg-mixed.c,
func-vararg-size0.c, inf-1.c, loop-index.c, nan-1.c, nan-2.c,
operator-arith-fold.c, operator-assignment.c, operator-comma.c,
operator-cond.c, operator-logical.c, operator-unary.c, snan.c,
struct-layout-1.c, union-init.c, usual-arith-conv.c: Remove dg-do
directives.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109779 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/c-compat.exp | 18 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 75 |
2 files changed, 72 insertions, 21 deletions
diff --git a/gcc/testsuite/lib/c-compat.exp b/gcc/testsuite/lib/c-compat.exp index 527058d445f..232ed3315db 100644 --- a/gcc/testsuite/lib/c-compat.exp +++ b/gcc/testsuite/lib/c-compat.exp @@ -1,4 +1,4 @@ -# Copyright (C) 2002, 2003, 2005, 02005 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -69,13 +69,13 @@ proc compat_setup_dfp { } { # If there is an alternate compiler, does it support decimal float types? if { $compat_use_alt == 1 && $compat_same_alt == 0 } { compat-use-alt-compiler - set compat_have_dfp [check_dfp] + set compat_have_dfp [check_effective_target_dfprt_nocache] compat-use-tst-compiler verbose "compat_have_dfp for alt compiler: $compat_have_dfp" 2 } # Does the compiler under test support it? if { $compat_have_dfp == 1 } { - set compat_have_dfp [check_dfp] + set compat_have_dfp [check_effective_target_dfprt_nocache] verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2 } @@ -87,18 +87,6 @@ proc compat_setup_dfp { } { } } -# Return 1 if the compiler supports decimal float types, 0 otherwise. -# -# Don't use check_effective_target since this will differ depending -# on the compiler, not the target. -# -proc check_dfp { } { - set result [string match "" [get_compiler_messages dfp2 object { - _Decimal32 x; _Decimal64 y; _Decimal128 z; - }]] - return $result -} - # If either compiler does not support decimal float types, skip this test. proc dg-require-compat-dfp { args } { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 04ead203480..cadef960460 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1999, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1055,7 +1056,54 @@ proc check_effective_target_lp64 { } { return $et_lp64_saved } -# Return 1 if the target supports Decimal Floating Point, 0 otherwise. +# Return 1 if the target supports compiling decimal floating point, +# 0 otherwise. + +proc check_effective_target_dfp_nocache { } { + verbose "check_effective_target_dfp_nocache: compiling source" 2 + set ret [string match "" [get_compiler_messages dfp object { + _Decimal32 x; _Decimal64 y; _Decimal128 z; + }]] + verbose "check_effective_target_dfp_nocache: returning $ret" 2 + return $ret +} + +proc check_effective_target_dfprt_nocache { } { + global tool + + set ret 0 + + verbose "check_effective_target_dfprt_nocache: compiling source" 2 + # Set up, compile, and execute a test program containing decimal + # float operations. + set src dfprt[pid].c + set exe dfprt[pid].x + + set f [open $src "w"] + puts $f "_Decimal32 x = 1.2df; _Decimal64 y = 2.3dd; _Decimal128 z;" + puts $f "int main () { z = x + y; return 0; }" + close $f + + verbose "check_effective_target_dfprt_nocache: compiling testfile $src" 2 + set lines [${tool}_target_compile $src $exe executable ""] + file delete $src + + if [string match "" $lines] then { + # No error message, compilation succeeded. + set result [${tool}_load "./$exe" "" ""] + set status [lindex $result 0] + remote_file build delete $exe + verbose "check_effective_target_dfprt_nocache: testfile status is <$status>" 2 + if { $status == "pass" } then { + set ret 1 + } + } + return $ret + verbose "check_effective_target_dfprt_nocache: returning $ret" 2 +} + +# Return 1 if the target supports compiling Decimal Floating Point, +# 0 otherwise. # # This won't change for different subtargets so cache the result. @@ -1065,15 +1113,30 @@ proc check_effective_target_dfp { } { if [info exists et_dfp_saved] { verbose "check_effective_target_dfp: using cached result" 2 } else { - verbose "check_effective_target_dfp: compiling source" 2 - set et_dfp_saved [string match "" [get_compiler_messages dfp object { - _Decimal32 x; _Decimal64 y; _Decimal128 z; - }]] + set et_dfp_saved [check_effective_target_dfp_nocache] } verbose "check_effective_target_dfp: returning $et_dfp_saved" 2 return $et_dfp_saved } +# Return 1 if the target supports linking and executing Decimal Floating +# Point, # 0 otherwise. +# +# This won't change for different subtargets so cache the result. + +proc check_effective_target_dfprt { } { + global et_dfprt_saved + global tool + + if [info exists et_dfprt_saved] { + verbose "check_effective_target_dfprt: using cached result" 2 + } else { + set et_dfprt_saved [check_effective_target_dfprt_nocache] + } + verbose "check_effective_target_dfprt: returning $et_dfprt_saved" 2 + return $et_dfprt_saved +} + # Return 1 if the target needs a command line argument to enable a SIMD # instruction set. # |