URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [testsuite/] [location-1.test] - Rev 6
Compare with Previous | Blame | View Log
# location testcase #1 -*- shell-script -*-
test=location-1
source ./test-utils.sh
cpu_file=${test}.test.cpu
rm -f ${cpu_file}
cat > ${cpu_file} <<EOF
(include "${srcdir}/../cpu/simplify.inc")
(include "${srcdir}/testsuite.cpu")
(define-pmacro test-insns (add sub))
(define-pmacro (define-test-insn name)
(bad-command name)
)
(.for-each (.pmacro (name)
(.exec (define-test-insn name)))
test-insns)
EOF
run_cgen -f ${cpu_file}
# Find line with "bad-command".
bad_loc=$(grep -n "bad-command" ${cpu_file} | sed -e 's/:.*$//')
if ! grep -q "unknown entry type:" ${test_output_file}
then
fail "bad command not detected"
elif ! grep -q "${cpu_file}:${bad_loc}:.*: unknown entry type:" ${test_output_file}
then
fail "bad command not detected on correct line"
fi
finish