Fix test for GCC support for atomics in Autotools
authorOndra Pelech <ondra.pelech@gmail.com>
Sun, 23 Sep 2018 21:14:53 +0000 (23:14 +0200)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Mon, 15 Oct 2018 08:29:50 +0000 (10:29 +0200)
PR: https://github.com/ghc/ghc/pull/198/

aclocal.m4

index 15b9f35..55b4162 100644 (file)
@@ -1303,7 +1303,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS],
 [
    AC_REQUIRE([AC_PROG_CC])
    AC_MSG_CHECKING([whether GCC supports __atomic_ builtins])
-   echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c
+   echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c
    if $CC -c conftest.c > /dev/null 2>&1; then
        CONF_GCC_SUPPORTS__ATOMICS=YES
        AC_MSG_RESULT([yes])