OSDN Git Service

* lib/target-supports.exp (check_effective_target_dfp_nocache,
authorjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jan 2006 00:09:27 +0000 (00:09 +0000)
committerjanis <janis@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jan 2006 00:09:27 +0000 (00:09 +0000)
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

45 files changed:
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/dfp/call-by-value.c
gcc/testsuite/gcc.dg/dfp/cast.c
gcc/testsuite/gcc.dg/dfp/compare-eq-const.c
gcc/testsuite/gcc.dg/dfp/compare-eq-d128.c
gcc/testsuite/gcc.dg/dfp/compare-eq-d32.c
gcc/testsuite/gcc.dg/dfp/compare-eq-d64.c
gcc/testsuite/gcc.dg/dfp/compare-eq-dfp.c
gcc/testsuite/gcc.dg/dfp/compare-rel-const.c
gcc/testsuite/gcc.dg/dfp/compare-rel-d128.c
gcc/testsuite/gcc.dg/dfp/compare-rel-d32.c
gcc/testsuite/gcc.dg/dfp/compare-rel-d64.c
gcc/testsuite/gcc.dg/dfp/compare-rel-dfp.c
gcc/testsuite/gcc.dg/dfp/convert-bfp-fold.c
gcc/testsuite/gcc.dg/dfp/convert-bfp.c
gcc/testsuite/gcc.dg/dfp/convert-complex.c
gcc/testsuite/gcc.dg/dfp/convert-dfp-fold.c
gcc/testsuite/gcc.dg/dfp/convert-dfp-round.c
gcc/testsuite/gcc.dg/dfp/convert-dfp.c
gcc/testsuite/gcc.dg/dfp/convert-int-fold.c
gcc/testsuite/gcc.dg/dfp/convert-int-saturate.c
gcc/testsuite/gcc.dg/dfp/dfp.exp
gcc/testsuite/gcc.dg/dfp/func-array.c
gcc/testsuite/gcc.dg/dfp/func-mixed.c
gcc/testsuite/gcc.dg/dfp/func-scalar.c
gcc/testsuite/gcc.dg/dfp/func-struct.c
gcc/testsuite/gcc.dg/dfp/func-vararg-dfp.c
gcc/testsuite/gcc.dg/dfp/func-vararg-mixed.c
gcc/testsuite/gcc.dg/dfp/func-vararg-size0.c
gcc/testsuite/gcc.dg/dfp/inf-1.c
gcc/testsuite/gcc.dg/dfp/loop-index.c
gcc/testsuite/gcc.dg/dfp/nan-1.c
gcc/testsuite/gcc.dg/dfp/nan-2.c
gcc/testsuite/gcc.dg/dfp/operator-arith-fold.c
gcc/testsuite/gcc.dg/dfp/operator-assignment.c
gcc/testsuite/gcc.dg/dfp/operator-comma.c
gcc/testsuite/gcc.dg/dfp/operator-cond.c
gcc/testsuite/gcc.dg/dfp/operator-logical.c
gcc/testsuite/gcc.dg/dfp/operator-unary.c
gcc/testsuite/gcc.dg/dfp/snan.c
gcc/testsuite/gcc.dg/dfp/struct-layout-1.c
gcc/testsuite/gcc.dg/dfp/union-init.c
gcc/testsuite/gcc.dg/dfp/usual-arith-conv.c
gcc/testsuite/lib/c-compat.exp
gcc/testsuite/lib/target-supports.exp

index 498e6d3..417a811 100644 (file)
@@ -1,3 +1,27 @@
+2006-01-16  Janis Johnson  <janis187@us.ibm.com>
+
+       * 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.
+
 2006-01-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR testsuite/25741
 2006-01-16  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR testsuite/25741
index 1fba25f..4232a30 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.9.1(9) Function definitions; parameter has automatic storage.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.9.1(9) Function definitions; parameter has automatic storage.
index 7b2b6d8..2cc8c1a 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.4 Cast operators.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.4 Cast operators.
index 55cb566..dd29520 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.9 Equality operators.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.9 Equality operators.
index 0635aa6..158e2f9 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
index d006fbe..d5e3bb3 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
index 4f2367a..8fa39df 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
index b5c302e..4203470 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.9 Equality operators.
index 50fc9d8..d2dda48 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.8 Relational operators.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.8 Relational operators.
index db58f5b..0d46925 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
index 128e264..257a3c2 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
index e1b9f95..73cbcee 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
index f4fd6be..58523b6 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.8 Relational operators.
index bb86507..7724e1d 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
index 53efdd1..5325848 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
index 5600dd4..9fa8ebe 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-O3" } */
 
 /* N1150 5.3 Conversions between decimal floating and complex.
 /* { dg-options "-O3" } */
 
 /* N1150 5.3 Conversions between decimal floating and complex.
index e87bfc6..8ccf22e 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
index 50f616a..87867fa 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-O0 -std=gnu99" } */
 
 /* N1150 5.2: Conversions among decimal floating types and between
 /* { dg-options "-O0 -std=gnu99" } */
 
 /* N1150 5.2: Conversions among decimal floating types and between
index 5fbbaad..bafe089 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* N1150 5.2 Conversions among decimal floating types and between
index 38516ed..99eaad8 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.1 Conversion between decimal floating integer.
 /* { dg-options "-std=gnu99 -O" } */
 
 /* N1150 5.1 Conversion between decimal floating integer.
index 3b7b5ca..9aeb1d7 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 5.1 Conversion between decimal floating integer.
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 5.1 Conversion between decimal floating integer.
index 52b4852..db5dde7 100644 (file)
@@ -25,6 +25,19 @@ if { ![check_effective_target_dfp] } {
     return;
 }
 
     return;
 }
 
+# If the decimal float is supported in the compiler but not yet in the
+# runtime, treat all tests as compile-only.
+global dg-do-what-default
+set save-dg-do-what-default ${dg-do-what-default}
+if { ![check_effective_target_dfprt] } {
+    verbose "dfp.exp: runtime support for decimal float does not exist" 2
+    set dg-do-what-default compile
+} else {
+    verbose "dfp.exp: runtime support for decimal float exists, use it" 2
+    set dg-do-what-default run
+}
+verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2
+
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CFLAGS
 if ![info exists DEFAULT_CFLAGS] then {
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CFLAGS
 if ![info exists DEFAULT_CFLAGS] then {
@@ -40,3 +53,6 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
 
 # All done.
 dg-finish
 
 # All done.
 dg-finish
+
+set dg-do-what-default ${save-dg-do-what-default}
+verbose "dfp.exp: dg-do-what-default is ${dg-do-what-default}" 2
index e71410f..0424280 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
index c5d9650..0c9fbc9 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -Wall" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99 -Wall" } */
 
 /* C99 6.5.2.2 Function calls.
index 743411e..66cf2e2 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
index 5f1be13..c2674e6 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
index 07340ed..0763ca7 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
index 6ee882d..b6c2dc0 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.
index 674a522..dc94709 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.  */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.2.2 Function calls.  */
index ae4f286..86aa9e4 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
index 511d70c..ff52189 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.8.5.2: The for statement.  */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.8.5.2: The for statement.  */
index 8f2f208..50972e0 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
index 8488614..e8a663e 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
 /* { dg-options "-std=gnu99" } */
 
 /* N1150 4: Characteristics of decimal floating types (not explicit)
index d753104..2c09e76 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do compile } */
 /* { dg-options "-std=gnu99 -O" } */
 
 /* C99 6.5.5: Multiplicative operators.
 /* { dg-options "-std=gnu99 -O" } */
 
 /* C99 6.5.5: Multiplicative operators.
index 79f91b4..490748f 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.16 Assignment operators.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.16 Assignment operators.
index 764e176..904f9b3 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.17: Comma operator.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.17: Comma operator.
index cade2dc..ff712bd 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.15 Conditional operator.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* C99 6.5.15 Conditional operator.
index 5130b11..90a94b0 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 Logical AND operator.
 /* { dg-options "-std=gnu99" } */
 
 /* C99 Logical AND operator.
index c3f67f6..bcf5068 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.3 Unary operators.  */
 /* { dg-options "-std=gnu99" } */
 
 /* C99 6.5.3 Unary operators.  */
index 26ea259..efc6e70 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "" } */
 
 /* FIXME: this test needs to be conditional to systems with POSIX signals.  */
 /* { dg-options "" } */
 
 /* FIXME: this test needs to be conditional to systems with POSIX signals.  */
index abb5327..9e54e48 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 #include <stdarg.h>
 /* { dg-options "-std=gnu99" } */
 
 #include <stdarg.h>
index e407847..fede76b 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99" } */
 
 /* Cast to union is a GNU C extension.  */
 /* { dg-options "-std=gnu99" } */
 
 /* Cast to union is a GNU C extension.  */
index 0c97b6c..584058b 100644 (file)
@@ -1,4 +1,3 @@
-/* { dg-do run } */
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* N1150 5.4: Usual arithmetic conversions.
 /* { dg-options "-std=gnu99 -O0" } */
 
 /* N1150 5.4: Usual arithmetic conversions.
index 527058d..232ed33 100644 (file)
@@ -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
 
 # 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
     # 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 } {
        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
     }
 
        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 } {
 # If either compiler does not support decimal float types, skip this test.
 
 proc dg-require-compat-dfp { args } {
index 04ead20..cadef96 100644 (file)
@@ -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
 
 # 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 $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.
 
 #
 # 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 {
     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
 }
 
     }
     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.
 #
 # Return 1 if the target needs a command line argument to enable a SIMD
 # instruction set.
 #