Add polly tests to configure file.
[llvm-testsuite.git] / HashProgramOutput.sh
blobc5ac2682b320e0ceefb25a2cfa5eeb1a848e3a31
1 #!/bin/sh
3 if [ $# != 1 ]; then
4 echo "$0 <output path>"
5 exit 1
6 fi
8 md5cmd=$(which md5sum)
9 is_md5sum=1
10 if [ ! -x "$md5cmd" ]; then
11 md5cmd=$(which md5)
12 is_md5sum=0
13 if [ ! -x "$md5cmd" ]; then
14 echo "error: unable to find either 'md5sum' or 'md5'"
15 exit 1
19 mv $1 $1.bak
20 if [ $is_md5sum = "0" ]; then
21 $md5cmd < $1.bak > $1
22 else
23 $md5cmd < $1.bak | cut -d' ' -f 1 > $1
25 rm -f $1.bak