[LLVMdev] LLVM test-suite support for dragonegg / Fortran

Duncan Sands baldrick at free.fr
Fri Nov 12 09:11:18 PST 2010


Hi Tobias,

> I committed an extended version of that patch to llvm core and the test suite.
> Can you have a look, if it works for you.

if I configure like this then the configure script thinks llvm-gcc is not
dragonegg:

configure --with-llvmgcc="gcc-4.5 -fplugin=path/dragonegg.so" 
--with-llvmgxx="g++-4.5 -fplugin=path/dragonegg.so"

There are several reasons for this.  First off, the test
   if test -x "$LLVMGCC" ; then
fails because "g++-4.5 -fplugin=path/dragonegg.so" is indeed not an executable.
This test is redundant, since you are about to execute the program on the next
lines, which will fail anyway.  Suppose this test is eliminated.  It still fails
because

   "$LLVMGCC" -fplugin-arg-dragonegg-emit-ir -S -o - conftest.c

won't execute, because "$LLVMGCC" is not an executable.  This can be cured by
removing the quotation marks.  This suggests the following patch, what do you
think?  I'm worried that this is the wrong approach.  If it is the right
approach, probably the testsuite configure files will need to be tweaked too.

Ciao,

Duncan.

--- configure	(revision 118890)
+++ configure	(working copy)
@@ -20569,16 +20569,14 @@
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    llvm_cv_llvmgcc_dragonegg="no"
-if test -x "$LLVMGCC" ; then
    cp /dev/null conftest.c
-  "$LLVMGCC" -fplugin-arg-dragonegg-emit-ir -S -o - conftest.c | \
+  $LLVMGCC -fplugin-arg-dragonegg-emit-ir -S -o - conftest.c | \
    grep 'target datalayout =' > /dev/null 2>&1
    if test $? -eq 0 ; then
      llvm_cv_llvmgcc_dragonegg="yes"
    fi
    rm conftest.c
  fi
-fi
  { echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc_dragonegg" >&5
  echo "${ECHO_T}$llvm_cv_llvmgcc_dragonegg" >&6; }

@@ -20598,32 +20596,30 @@
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    llvm_cv_llvmgcc_sanity="no"
-if test -x "$LLVMGCC" ; then
    cp /dev/null conftest.c
-  "$LLVMGCC" "$LLVMCC_EMITIR_FLAG" -S -o - conftest.c | \
+  $LLVMGCC "$LLVMCC_EMITIR_FLAG" -S -o - conftest.c | \
        grep 'target datalayout =' > /dev/null 2>&1
    if test $? -eq 0 ; then
      llvm_cv_llvmgcc_sanity="yes"
    fi
    rm conftest.c
  fi
-fi
  { echo "$as_me:$LINENO: result: $llvm_cv_llvmgcc_sanity" >&5
  echo "${ECHO_T}$llvm_cv_llvmgcc_sanity" >&6; }

  if test "$llvm_cv_llvmgcc_sanity" = "yes" ; then
    { echo "$as_me:$LINENO: checking llvm-gcc component support" >&5
  echo $ECHO_N "checking llvm-gcc component support... $ECHO_C" >&6; }
-  llvmcc1path=`"$LLVMGCC" --print-prog-name=cc1`
+  llvmcc1path=`$LLVMGCC --print-prog-name=cc1`
    LLVMCC1=$llvmcc1path

-  llvmcc1pluspath=`"$LLVMGCC" --print-prog-name=cc1plus`
+  llvmcc1pluspath=`$LLVMGCC --print-prog-name=cc1plus`
    LLVMCC1PLUS=$llvmcc1pluspath

    llvmgccdir=`echo "$llvmcc1path" | sed 's,/libexec/.*,,'`
    LLVMGCCDIR=$llvmgccdir

-  llvmgcclangs=`"$LLVMGCC" -v --help 2>&1 | grep '^Configured with:' | sed 
's/^.*--enable-languages=\([^ ]*\).*/\1/'`
+  llvmgcclangs=`$LLVMGCC -v --help 2>&1 | grep '^Configured with:' | sed 
's/^.*--enable-languages=\([^ ]*\).*/\1/'`
    LLVMGCC_LANGS=$llvmgcclangs

    LLVMGCC_DRAGONEGG=$llvm_cv_llvmgcc_dragonegg



More information about the llvm-dev mailing list