Revert "[lldb] Add template method for getting const or mutable regs from DynamicRegi...
[llvm-project.git] / polly / test / create_ll.sh
blobc44d8ed81f2b522a681b844789b5e5f6616ee3b9
1 #!/bin/sh -e
3 LLFILE=`echo $1 | sed -e 's/\.c/.ll/g'`
4 LLFILE_TMP=${LLFILE}.tmp
5 SOURCE=$1
7 shift
9 clang -c -S -emit-llvm -O3 -mllvm -disable-llvm-optzns ${SOURCE} -o ${LLFILE} "$@"
11 opt -correlated-propagation -mem2reg -instcombine -loop-simplify -indvars \
12 -instnamer ${LLFILE} -S -o ${LLFILE_TMP}
14 # Insert a header into the new testcase containing a sample RUN line a FIXME and
15 # an XFAIL. Then insert the formated C code and finally the LLVM-IR without
16 # attributes, the module ID or the target triple.
17 echo '; RUN: opt %loadPolly -S < %s | FileCheck %s' > ${LLFILE}
18 echo ';' >> ${LLFILE}
19 echo '; FIXME: Edit the run line and add checks!' >> ${LLFILE}
20 echo ';' >> ${LLFILE}
21 echo '; XFAIL: *' >> ${LLFILE}
22 echo ';' >> ${LLFILE}
23 clang-format ${SOURCE} | sed -e 's/^[^$]/; &/' -e 's/^$/;/' >> ${LLFILE}
24 echo ';' >> ${LLFILE}
26 cat ${LLFILE_TMP} >> ${LLFILE}
27 sed -i".tmp" '/attributes .* =/d' ${LLFILE}
28 sed -i".tmp" -e 's/) \#[0-9]*/)/' ${LLFILE}
29 sed -i".tmp" '/; Function Attrs:/d' ${LLFILE}
30 sed -i".tmp" '/; ModuleID =/d' ${LLFILE}
31 sed -i".tmp" '/target triple/d' ${LLFILE}
33 mv ${LLFILE_TMP} ${LLFILE}