Commit 265e7d50 by Janis Johnson Committed by Janis Johnson

target-supports.exp (check_effective_target_dfp_nocache, [...]): New.

	* 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.

From-SVN: r109779
parent acb6e9be
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
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.9.1(9) Function definitions; parameter has automatic storage.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.4 Cast operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.9 Equality operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.9 Equality operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.9 Equality operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.9 Equality operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.9 Equality operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.8 Relational operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.8 Relational operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.8 Relational operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.8 Relational operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.8 Relational operators.
......
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O" } */
/* N1150 5.2 Conversions among decimal floating types and between
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* N1150 5.2 Conversions among decimal floating types and between
......
/* { dg-do run } */
/* { dg-options "-O3" } */
/* N1150 5.3 Conversions between decimal floating and complex.
......
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O" } */
/* N1150 5.2 Conversions among decimal floating types and between
......
/* { dg-do run } */
/* { dg-options "-O0 -std=gnu99" } */
/* N1150 5.2: Conversions among decimal floating types and between
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* N1150 5.2 Conversions among decimal floating types and between
......
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O" } */
/* N1150 5.1 Conversion between decimal floating integer.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* N1150 5.1 Conversion between decimal floating integer.
......
......@@ -25,6 +25,19 @@ if { ![check_effective_target_dfp] } {
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 {
......@@ -40,3 +53,6 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
# 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
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -Wall" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.2.2 Function calls. */
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* N1150 4: Characteristics of decimal floating types (not explicit)
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.8.5.2: The for statement. */
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* N1150 4: Characteristics of decimal floating types (not explicit)
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* N1150 4: Characteristics of decimal floating types (not explicit)
......
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O" } */
/* C99 6.5.5: Multiplicative operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.16 Assignment operators.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.17: Comma operator.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* C99 6.5.15 Conditional operator.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 Logical AND operator.
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* C99 6.5.3 Unary operators. */
......
/* { dg-do run } */
/* { dg-options "" } */
/* FIXME: this test needs to be conditional to systems with POSIX signals. */
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
#include <stdarg.h>
......
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* Cast to union is a GNU C extension. */
......
/* { dg-do run } */
/* { dg-options "-std=gnu99 -O0" } */
/* N1150 5.4: Usual arithmetic conversions.
......
# 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 } {
......
# 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.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment