From 55ac4e01c17abf9122c01e7cac799c215bc22925 Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Fri, 25 Jan 2019 13:36:37 +0000 Subject: [PATCH] [testsuite] Add missing fenv effective target to fp-int-convert-timode* tests. 2019-01-25 Christophe Lyon gcc/ * doc/sourcebuild.texi (Environment attributes): Add fenv and fenv_exceptions description. 2019-01-25 Christophe Lyon gcc/testsuite/ * lib/target-supports.exp (check_effective_target_fenv): New. * gcc.dg/torture/fp-int-convert-float128-timode-3.c: Add missing fenv effective target. * gcc.dg/torture/fp-int-convert-timode-1.c: Likewise. * gcc.dg/torture/fp-int-convert-timode-2.c: Likewise. * gcc.dg/torture/fp-int-convert-timode-3.c: Likewise. * gcc.dg/torture/fp-int-convert-timode-4.c: Likewise. From-SVN: r268266 --- gcc/ChangeLog | 5 +++++ gcc/doc/sourcebuild.texi | 7 +++++++ gcc/testsuite/ChangeLog | 10 ++++++++++ .../gcc.dg/torture/fp-int-convert-float128-timode-3.c | 1 + gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c | 1 + gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c | 1 + gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c | 1 + gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c | 1 + gcc/testsuite/lib/target-supports.exp | 8 ++++++++ 9 files changed, 35 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87794469c3b..ff46540a085 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-01-25 Christophe Lyon + + * doc/sourcebuild.texi (Environment attributes): Add fenv and + fenv_exceptions description. + 2019-01-25 Wilco Dijkstra PR rtl-optimization/87763 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 32a8f6aa12a..a6704569d50 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2128,6 +2128,13 @@ Target can truncate a file from a file descriptor, as used by @file{libgfortran/io/unix.c:fd_truncate}; i.e.@: @code{ftruncate} or @code{chsize}. +@item fenv +Target provides @file{fenv.h} include file. + +@item fenv_exceptions +Target supports @file{fenv.h} with all the standard IEEE exceptions +and floating-point exceptions are raised by arithmetic operations. + @item freestanding Target is @samp{freestanding} as defined in section 4 of the C99 standard. Effectively, it is a target which supports no extra headers or libraries diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9803c91e40b..10536c9b220 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2019-01-25 Christophe Lyon + + * lib/target-supports.exp (check_effective_target_fenv): New. + * gcc.dg/torture/fp-int-convert-float128-timode-3.c: Add missing + fenv effective target. + * gcc.dg/torture/fp-int-convert-timode-1.c: Likewise. + * gcc.dg/torture/fp-int-convert-timode-2.c: Likewise. + * gcc.dg/torture/fp-int-convert-timode-3.c: Likewise. + * gcc.dg/torture/fp-int-convert-timode-4.c: Likewise. + 2019-01-25 Richard Biener PR tree-optimization/86865 diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c index fa6eb6b72bf..c445d10522e 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-float128-timode-3.c @@ -4,6 +4,7 @@ /* { dg-require-effective-target __float128 } */ /* { dg-require-effective-target base_quadfloat_support } */ /* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target fenv } */ /* { dg-options "-frounding-math" } */ /* { dg-add-options __float128 } */ diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c index d6454fada72..0c524a8c478 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-1.c @@ -2,6 +2,7 @@ float. */ /* { dg-do run } */ /* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target fenv } */ /* { dg-options "-frounding-math" } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c index dbfa481b4fb..a82f03d079c 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-2.c @@ -2,6 +2,7 @@ float. */ /* { dg-do run } */ /* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target fenv } */ /* { dg-options "-frounding-math" } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c index 63a305ec3c2..707d539335f 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-3.c @@ -2,6 +2,7 @@ float. */ /* { dg-do run } */ /* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target fenv } */ /* { dg-options "-frounding-math" } */ #include diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c index e71610995cd..09600f90903 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert-timode-4.c @@ -2,6 +2,7 @@ float. */ /* { dg-do run } */ /* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target fenv } */ /* { dg-options "-frounding-math" } */ #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index c0df467e017..92202ffcbf0 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8536,6 +8536,14 @@ proc check_effective_target_avr_tiny { } { } } +# Return 1 if is available. + +proc check_effective_target_fenv {} { + return [check_no_compiler_messages fenv object { + #include + } [add_options_for_ieee "-std=gnu99"]] +} + # Return 1 if is available with all the standard IEEE # exceptions and floating-point exceptions are raised by arithmetic # operations. (If the target requires special options for "inexact" -- 2.30.2