summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/c-compat.exp
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-11 21:29:59 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2006-01-11 21:29:59 +0000
commit41a20961fce18fb62efd1af115096db194ea442c (patch)
tree9aff0dc626b4d53c1ff32ce6d509433c47ba166d /gcc/testsuite/lib/c-compat.exp
parentbebf8106efd68a7fb12219087852ec819deec904 (diff)
downloadgcc-41a20961fce18fb62efd1af115096db194ea442c.tar.gz
* gcc.dg/nodfp-1.c: New test.
* gcc.dg/compat/scalar-return-dfp_x.c: Likewise. * gcc.dg/compat/scalar-return-dfp_x.c: Likewise. * gcc.dg/compat/scalar-return-dfp_main.c: Likewise. * gcc.dg/compat/scalar-by-value-dfp_main.c: Likewise. * gcc.dg/compat/scalar-by-value-dfp_x.c: Likewise. * gcc.dg/compat/scalar-return-dfp_y.c: Likewise. * gcc.dg/compat/scalar-by-value-dfp_y.c: Likewise. * gcc.dg/debug/dwarf2/dwarf-float.c: Likewise. * gcc.dg/debug/dwarf2/dwarf-dfp.c: Likewise. * gcc.dg/format/dfp-scanf-1.c: Likewise. * gcc.dg/format/dfp-printf-1.c: Likewise. * gcc.dg/compat/struct-layout-1.exp: Use c-compat.exp. (compat_setup_dfp): New. * gcc.dg/compat/compat.exp: Use it. (compat-use-alt-compiler, compat-use-tst-compiler): Move to new file. Make some variables global, prepend "compat_" to their names. * gcc.dg/compat/struct-layout-1.h: Conditional DFP support. * gcc.dg/compat/struct-layout-1_generate.c: Ditto. * gcc.misc-tests/dectest.exp: New test driver for decTest. * lib/compat.exp (compat_skip_list): Make global, rename. * lib/c-compat.exp: New file. * lib/target-supports.exp (check_effective_target_dfp): New. * gcc.dg/dfp/dec-eval-method.c, gcc.dg/dfp/func-array.c, gcc.dg/dfp/convert-dfp-fold.c, gcc.dg/dfp/struct-union.c, gcc.dg/dfp/compare-rel.h, gcc.dg/dfp/convert-dfp-round.c, gcc.dg/dfp/func-struct.c, gcc.dg/dfp/constants-c99.c, gcc.dg/dfp/compare-eq-d32.c, gcc.dg/dfp/func-vararg-mixed.c, gcc.dg/dfp/compare-rel-d128.c, gcc.dg/dfp/operator-comma.c, gcc.dg/dfp/decfloat-constants.c, gcc.dg/dfp/operator-bitwise.c, gcc.dg/dfp/func-mixed.c, gcc.dg/dfp/compare-eq-dfp.c, gcc.dg/dfp/operator-assignment.c, gcc.dg/dfp/dfp-round.h, gcc.dg/dfp/modes.c, gcc.dg/dfp/keywords-c99.c, gcc.dg/dfp/nan-1.c, gcc.dg/dfp/loop-index.c, gcc.dg/dfp/compare-eq-d64.c, gcc.dg/dfp/convert-bfp.c, gcc.dg/dfp/usual-arith-conv-const.c, gcc.dg/dfp/convert-dfp.c, gcc.dg/dfp/compare-rel-const.c, gcc.dg/dfp/convert-int-fold.c, gcc.dg/dfp/keywords-pedantic.c, gcc.dg/dfp/compare-rel-d32.c, gcc.dg/dfp/call-by-value.c, gcc.dg/dfp/constants-hex.c, gcc.dg/dfp/func-scalar.c, gcc.dg/dfp/keywords-ignored-c99.c, gcc.dg/dfp/snan.c, gcc.dg/dfp/usual-arith-conv.c, gcc.dg/dfp/constants-pedantic.c, gcc.dg/dfp/operator-logical.c, gcc.dg/dfp/compare-eq-d128.c, gcc.dg/dfp/convert-bfp-fold.c, gcc.dg/dfp/ctypes.c, gcc.dg/dfp/convert-int.c, gcc.dg/dfp/keywords-c89.c, gcc.dg/dfp/constants.c, gcc.dg/dfp/compare-rel-dfp.c, gcc.dg/dfp/compare-eq-const.c, gcc.dg/dfp/cast-bad.c, gcc.dg/dfp/operator-arith-fold.c, gcc.dg/dfp/union-init.c, gcc.dg/dfp/struct-layout-1.c, gcc.dg/dfp/compare-eq.hgcc.dg/dfp/convert-int-saturate.c, gcc.dg/dfp/compare-rel-d64.c, gcc.dg/dfp/func-vararg-size0.c, gcc.dg/dfp/Wconversion-2.c, gcc.dg/dfp/nan-2.c, gcc.dg/dfp/operator-cond.c, gcc.dg/dfp/composite-type.c, gcc.dg/dfp/func-vararg-dfp.c, gcc.dg/dfp/dfp.expgcc.dg/dfp/keywords-reserved.c, gcc.dg/dfp/convert-complex.c, gcc.dg/dfp/Wbad-function-cast-1.c, gcc.dg/dfp/operator-unary.c, gcc.dg/dfp/altivec-types.c, gcc.dg/dfp/cast.c, gcc.dg/dfp/typespec.c, gcc.dg/dfp/wtr-conversion-1.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109604 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib/c-compat.exp')
-rw-r--r--gcc/testsuite/lib/c-compat.exp110
1 files changed, 110 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/c-compat.exp b/gcc/testsuite/lib/c-compat.exp
new file mode 100644
index 00000000000..527058d445f
--- /dev/null
+++ b/gcc/testsuite/lib/c-compat.exp
@@ -0,0 +1,110 @@
+# Copyright (C) 2002, 2003, 2005, 02005 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# gcc-patches@gcc.gnu.org
+
+# Globals.
+
+global compat_use_alt
+global compat_same_alt
+global compat_have_dfp
+global compat_skip_list
+
+# This file defines procs for determining features supported by both C
+# compilers for compatibility tests.
+
+load_lib target-supports.exp
+
+#
+# compat-use-alt-compiler -- make the alternate compiler the default
+#
+proc compat-use-alt-compiler { } {
+ global GCC_UNDER_TEST ALT_CC_UNDER_TEST
+ global compat_same_alt
+
+ # We don't need to do this if the alternate compiler is actually
+ # the same as the compiler under test.
+ if { $compat_same_alt == 0 } then {
+ set GCC_UNDER_TEST $ALT_CC_UNDER_TEST
+ }
+}
+
+#
+# compat-use-tst-compiler -- make compiler under test the default
+#
+proc compat-use-tst-compiler { } {
+ global GCC_UNDER_TEST compat_save_gcc_under_test
+ global compat_same_alt
+
+ # We don't need to do this if the alternate compiler is actually
+ # the same as the compiler under test.
+
+ if { $compat_same_alt == 0 } then {
+ set GCC_UNDER_TEST $compat_save_gcc_under_test
+ }
+}
+
+# Find out whether both compilers support decimal float types.
+proc compat_setup_dfp { } {
+ global compat_use_alt
+ global compat_same_alt
+ global compat_have_dfp
+
+ verbose "compat_setup_dfp: $compat_use_alt $compat_same_alt" 2
+ set compat_have_dfp 1
+ # 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]
+ 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]
+ verbose "compat_have_dfp for tst compiler: $compat_have_dfp" 2
+ }
+
+ # If decimal float is not supported, add it to the skip list, which
+ # affects code in the header files.
+ if { $compat_have_dfp == 0 } {
+ global compat_skip_list
+ lappend compat_skip_list "DECIMAL_FLOAT"
+ }
+}
+
+# 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 } {
+ global compat_have_dfp
+ if { $compat_have_dfp == 0 } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ }
+}