summaryrefslogtreecommitdiff
path: root/libgfortran/acinclude.m4
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-15 21:30:43 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-15 21:30:43 +0000
commit9af9660ca689894fe51b696a63bfe81713bd4cd6 (patch)
treeea8ca213cedb7992d8e77abb99f171de9ede42aa /libgfortran/acinclude.m4
parent18669cea5ad136747b93554568ba8f5eedd69584 (diff)
downloadgcc-9af9660ca689894fe51b696a63bfe81713bd4cd6.tar.gz
2011-02-15 Tobias Burnus <burnus@net-b.de>
PR fortran/47716 PR fortran/47648 * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Use check from libquadmath, which uses more features. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170200 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r--libgfortran/acinclude.m445
1 files changed, 27 insertions, 18 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 9873d9f2392..1bc1c7bbbfd 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -284,24 +284,33 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
AC_CACHE_CHECK([whether we have a usable __float128 type],
libgfor_cv_have_float128, [
- AC_TRY_LINK([
-/* no header */
-],[
- typedef _Complex float __attribute__((mode(TC))) __complex128;
-
- __float128 x;
- x = __builtin_huge_valq() - 2.e1000Q;
-
- __complex128 z1, z2;
- z1 = x;
- z2 = 2.Q;
-
- z1 /= z2;
- z1 /= 7.Q;
-],
- libgfor_cv_have_float128=yes,
- libgfor_cv_have_float128=no)
- ])
+ GCC_TRY_COMPILE_OR_LINK([
+ typedef _Complex float __attribute__((mode(TC))) __complex128;
+
+ __float128 foo (__float128 x)
+ {
+
+ __complex128 z1, z2;
+
+ z1 = x;
+ z2 = x / 7.Q;
+ z2 /= z1;
+
+ return (__float128) z2;
+ }
+
+ __float128 bar (__float128 x)
+ {
+ return x * __builtin_huge_valq ();
+ }
+ ],[
+ foo (1.2Q);
+ bar (1.2Q);
+ ],[
+ libgfor_cv_have_float128=yes
+ ],[
+ libgfor_cv_have_float128=no
+])])
if test "x$libgfor_cv_have_float128" = xyes; then
AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.])