mangle.c (write_builtin_type): Support decimal float types.
* mangle.c (write_builtin_type): Support decimal float types. * g++.dg/dfp: New directory. * g++.dg/dg.exp: Prune tests in dfp directory. * g++.dg/dfp/dfp/exp: New. * g++.dg/dfp/mangle-mode.C: New test. From-SVN: r152242
This commit is contained in:
parent
384c400a82
commit
d366d023cb
6 changed files with 117 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2009-09-28 Janis Johnson <janis187@us.ibm.com>
|
||||
|
||||
* mangle.c (write_builtin_type): Support decimal float types.
|
||||
|
||||
2009-09-28 Richard Henderson <rth@redhat.com>
|
||||
|
||||
* cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
|
||||
|
|
|
@ -1894,6 +1894,12 @@ write_builtin_type (tree type)
|
|||
write_char ('d');
|
||||
else if (type == long_double_type_node)
|
||||
write_char ('e');
|
||||
else if (type == dfloat32_type_node)
|
||||
write_string ("Df");
|
||||
else if (type == dfloat64_type_node)
|
||||
write_string ("Dd");
|
||||
else if (type == dfloat128_type_node)
|
||||
write_string ("De");
|
||||
else
|
||||
gcc_unreachable ();
|
||||
break;
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2009-09-28 Janis Johnson <janis187@us.ibm.com>
|
||||
|
||||
* g++.dg/dfp: New directory.
|
||||
* g++.dg/dg.exp: Prune tests in dfp directory.
|
||||
* g++.dg/dfp/dfp/exp: New.
|
||||
* g++.dg/dfp/mangle-mode.C: New test.
|
||||
|
||||
2009-09-28 Michael Matz <matz@suse.de>
|
||||
|
||||
* gcc.dg/builtins-44.c: Use __builtin_isinf_sign when checking
|
||||
|
|
62
gcc/testsuite/g++.dg/dfp/dfp.exp
Normal file
62
gcc/testsuite/g++.dg/dfp/dfp.exp
Normal file
|
@ -0,0 +1,62 @@
|
|||
# Copyright (C) 2005, 2006, 2007, 2009 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 3 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 GCC; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
|
||||
# GCC testsuite that uses the `dg.exp' driver.
|
||||
|
||||
# Load support procs.
|
||||
load_lib g++-dg.exp
|
||||
|
||||
# Skip these tests for targets that don't support this extension.
|
||||
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
|
||||
|
||||
global DEFAULT_CXXFLAGS
|
||||
if [info exists DEFAULT_CXXFLAGS] then {
|
||||
set save_default_cxxflags DEFAULT_CXXFLAGS
|
||||
}
|
||||
|
||||
# If a testcase doesn't have special options, use these.
|
||||
set DEFAULT_CXXFLAGS ""
|
||||
|
||||
# Initialize `dg'.
|
||||
dg-init
|
||||
|
||||
# Main loop.
|
||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[C]] \
|
||||
"" $DEFAULT_CXXFLAGS
|
||||
|
||||
# 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
|
||||
if [info exists save_default_cxxflags] {
|
||||
set DEFAULT_CXXFLAGS $save_default_cxxflags
|
||||
}
|
37
gcc/testsuite/g++.dg/dfp/mangle-mode.C
Normal file
37
gcc/testsuite/g++.dg/dfp/mangle-mode.C
Normal file
|
@ -0,0 +1,37 @@
|
|||
// { dg-do compile }
|
||||
|
||||
// Check that the compiler mangles types defined with decimal float
|
||||
// modes according to the vendor-neutral C++ ABI.
|
||||
|
||||
typedef float _Decimal32 __attribute__((mode(SD)));
|
||||
typedef float _Decimal64 __attribute__((mode(DD)));
|
||||
typedef float _Decimal128 __attribute__((mode(TD)));
|
||||
|
||||
extern void foo32 (_Decimal32 a, _Decimal32 &b, _Decimal32 *c);
|
||||
extern void foo64 (_Decimal64 *a, _Decimal64 b, _Decimal64 &c);
|
||||
extern void foo128 (_Decimal128 &a, _Decimal128 *b, _Decimal128 c);
|
||||
|
||||
void
|
||||
bar32 (void)
|
||||
{
|
||||
_Decimal32 x, y, z;
|
||||
foo32 (x, y, &z);
|
||||
}
|
||||
|
||||
void
|
||||
bar64 (void)
|
||||
{
|
||||
_Decimal64 x, y, z;
|
||||
foo64 (&x, y, z);
|
||||
}
|
||||
|
||||
void
|
||||
bar128 (void)
|
||||
{
|
||||
_Decimal128 x, y, z;
|
||||
foo128 (x, &y, z);
|
||||
}
|
||||
|
||||
// { dg-final { scan-assembler "Z5foo32DfRDfPDf" } }
|
||||
// { dg-final { scan-assembler "Z5foo64PDdDdRDd" } }
|
||||
// { dg-final { scan-assembler "Z6foo128RDePDeDe" } }
|
|
@ -35,6 +35,7 @@ set tests [prune $tests $srcdir/$subdir/bprob/*]
|
|||
set tests [prune $tests $srcdir/$subdir/charset/*]
|
||||
set tests [prune $tests $srcdir/$subdir/compat/*]
|
||||
set tests [prune $tests $srcdir/$subdir/debug/*]
|
||||
set tests [prune $tests $srcdir/$subdir/dfp/*]
|
||||
set tests [prune $tests $srcdir/$subdir/gcov/*]
|
||||
set tests [prune $tests $srcdir/$subdir/pch/*]
|
||||
set tests [prune $tests $srcdir/$subdir/plugin/*]
|
||||
|
|
Loading…
Add table
Reference in a new issue