polybench_test.sh.in: do not perform openmp tests when using clang
[ppcg.git] / m4 / ax_check_openmp.m4
blob4b2b7488f8e93478eea4db667fc48f0293497da6
1 # Check if $CC supports openmp.
2 # While clang (3.5) accepts the -fopenmp flag, it produces bad code
3 # on some PolyBench benchmarks, so it is blacklisted.
4 AC_DEFUN([AX_CHECK_OPENMP], [
5         AC_SUBST(HAVE_OPENMP)
6         HAVE_OPENMP=no
7         AC_MSG_CHECKING([for OpenMP support by $CC])
8         echo | $CC -x c - -fsyntax-only -fopenmp -Werror >/dev/null 2>/dev/null
9         if test $? -eq 0; then
10                 HAVE_OPENMP=yes
11         fi
12         AC_MSG_RESULT($HAVE_OPENMP)
13         if test $HAVE_OPENMP = yes; then
14                 $CC --version | grep clang > /dev/null
15                 if test $? -eq 0; then
16                         AC_MSG_NOTICE([clang blacklisted])
17                         HAVE_OPENMP=no
18                 fi
19         fi