1dnl SPDX-License-Identifier: GPL-2.0-or-later 2dnl Copyright (c) Linux Test Project, 2016 3 4AC_DEFUN([LTP_CHECK_ATOMIC_MEMORY_MODEL],[ 5 AC_MSG_CHECKING([for __atomic_* compiler builtins]) 6 AC_LINK_IFELSE([AC_LANG_SOURCE([ 7int main(void) { 8 int i = 0, j = 0; 9 __atomic_add_fetch(&i, 1, __ATOMIC_ACQ_REL); 10 __atomic_load_n(&i, __ATOMIC_SEQ_CST); 11 __atomic_store_n(&i, 0, __ATOMIC_RELAXED); 12 return i; 13}])],[has_atomic_mm="yes"]) 14 15if test "x$has_atomic_mm" = xyes; then 16 AC_DEFINE(HAVE_ATOMIC_MEMORY_MODEL,1, 17 [Define to 1 if you have the __atomic_* compiler builtins]) 18 AC_MSG_RESULT(yes) 19else 20 AC_MSG_RESULT(no) 21fi 22]) 23