view tester.sh @ 36:c0967c4b2a74 trunk

[svn r40] Cleaned up some of the array routines to use gep/load/store instead of memcpy/memset. Resizing arrays did not allocate enough memory for types bigger than 1 byte.
author lindquist
date Tue, 09 Oct 2007 07:51:13 +0200
parents 3cfcb944304e
children 8b0e809563df
line wrap: on
line source

#!/bin/bash

if [ -z $1 ]; then
    echo "you need to specify the test name"
    exit 1
fi

if [ "$2" = "ll" ]; then
    llvmdc $1 -Itest -odtest -c &&
    llvm-dis -f $1.bc &&
    cat $1.ll
    exit $?
elif [ "$2" = "llopt" ]; then
    llvmdc $1 -Itest -odtest -c &&
    opt -f -o=$1.bc -std-compile-opts $1.bc &&
    llvm-dis -f $1.bc &&
    cat $1.ll
    exit $?
elif [ "$2" = "run" ]; then
    llvmdc $1 lib/lphobos.bc -Itest -odtest -of$1 &&
    $1
    exit $?
elif [ "$2" = "c" ]; then
    llvmdc $1 -Itest -odtest -c
    exit $?
elif [ "$2" = "gdb" ]; then
    gdb --args llvmdc $1 -Itest -odtest -c
    exit $?
elif [ "$2" = "gdbrun" ]; then
    llvmdc $1 -Itest -odtest -c &&
    gdb $1
    exit $?
else
    echo "bad command or filename"
fi