1*49cdfc7eSAndroid Build Coastguard Workerdnl SPDX-License-Identifier: GPL-2.0-or-later 2*49cdfc7eSAndroid Build Coastguard Workerdnl Copyright (c) Linux Test Project, 2016 3*49cdfc7eSAndroid Build Coastguard Worker 4*49cdfc7eSAndroid Build Coastguard WorkerAC_DEFUN([LTP_CHECK_SYNC_ADD_AND_FETCH],[ 5*49cdfc7eSAndroid Build Coastguard Worker AC_MSG_CHECKING([for __sync_add_and_fetch]) 6*49cdfc7eSAndroid Build Coastguard Worker AC_LINK_IFELSE([AC_LANG_SOURCE([ 7*49cdfc7eSAndroid Build Coastguard Workerint main(void) { 8*49cdfc7eSAndroid Build Coastguard Worker int i = 0; 9*49cdfc7eSAndroid Build Coastguard Worker return __sync_add_and_fetch(&i, 1); 10*49cdfc7eSAndroid Build Coastguard Worker}])],[has_saac="yes"]) 11*49cdfc7eSAndroid Build Coastguard Worker 12*49cdfc7eSAndroid Build Coastguard Workerif test "x$has_saac" = xyes; then 13*49cdfc7eSAndroid Build Coastguard Worker AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH,1,[Define to 1 if you have __sync_add_and_fetch]) 14*49cdfc7eSAndroid Build Coastguard Worker AC_MSG_RESULT(yes) 15*49cdfc7eSAndroid Build Coastguard Workerelse 16*49cdfc7eSAndroid Build Coastguard Worker AC_MSG_RESULT(no) 17*49cdfc7eSAndroid Build Coastguard Workerfi 18*49cdfc7eSAndroid Build Coastguard Worker]) 19