about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-24 14:24:08 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-04-17 16:12:40 -0300
commite66d55582371553254d4e1893c0a43faf7bce001 (patch)
treec1489467180b22cdd6e8defb39c635da9097d25c /configure.ac
parent932dda54e72f468f287ec3c8176598830757e334 (diff)
downloadglibc-e66d55582371553254d4e1893c0a43faf7bce001.tar.gz
glibc-e66d55582371553254d4e1893c0a43faf7bce001.tar.xz
glibc-e66d55582371553254d4e1893c0a43faf7bce001.zip
math: Only build tests for _Complex __int128 iff compiler supports it
clang fails building test-tgmath3-atan2.c:

  error: '_Complex __int128' is invalid
  _Complex __int128 var__Complex___int128 __attribute__ ((unused));

since it does not support _Complex with __int128.  So disable
the test in such case.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index ff3f62c063..2f90025a1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1491,6 +1491,23 @@ LIBC_TRY_CC_OPTION([-Werror -ffloat-store],
 LIBC_CONFIG_VAR([config-cflags-float-store],
 		[$libc_cv_cc_float_store])
 
+AC_CACHE_CHECK([whether compiler supports _Complex with __int128],
+	       [libc_cv_complex_int128], [dnl
+cat > conftest.c <<EOF
+#ifndef __SIZEOF_INT128__
+# error "__int128 not supported"
+#endif
+_Complex __int128 var;
+EOF
+libc_cv_complex_int128=no
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c 1>&AS_MESSAGE_LOG_FD])
+then
+  libc_cv_complex_int128=yes
+fi
+rm -f conftest*])
+LIBC_CONFIG_VAR([config-complex-int128],
+                [$libc_cv_complex_int128])
+
 AC_CACHE_CHECK(if $CC accepts -fno-tree-loop-distribute-patterns with \
 __attribute__ ((__optimize__)), libc_cv_cc_loop_to_function, [dnl
 cat > conftest.c <<EOF