3 LLFILE
=`echo $1 | sed -e 's/\.c/.ll/g'`
4 LLFILE_TMP
=${LLFILE}.tmp
6 clang
-c -S -emit-llvm -O3 -mllvm -disable-llvm-optzns $1 -o ${LLFILE}
8 opt
-correlated-propagation -mem2reg -instcombine -loop-simplify -indvars \
9 -instnamer ${LLFILE} -S -o ${LLFILE_TMP}
11 # Insert a header into the new testcase containing a sample RUN line a FIXME and
12 # an XFAIL. Then insert the formated C code and finally the LLVM-IR without
13 # attributes, the module ID or the target triple.
14 echo '; RUN: opt %loadPolly -analyze < %s | FileCheck %s' > ${LLFILE}
16 echo '; FIXME: Edit the run line and add checks!' >> ${LLFILE}
18 echo '; XFAIL: *' >> ${LLFILE}
20 clang-format
$1 |
sed -e 's/^[^$]/; &/' -e 's/^$/;/' >> ${LLFILE}
23 cat ${LLFILE_TMP} >> ${LLFILE}
24 sed -i".tmp" '/attributes .* =/d' ${LLFILE}
25 sed -i".tmp" -e 's/) \#[0-9]*/)/' ${LLFILE}
26 sed -i".tmp" '/; Function Attrs:/d' ${LLFILE}
27 sed -i".tmp" '/; ModuleID =/d' ${LLFILE}
28 sed -i".tmp" '/target triple/d' ${LLFILE}
30 mv ${LLFILE_TMP} ${LLFILE}