aboutsummaryrefslogtreecommitdiff
path: root/test_compile.sh
blob: 073231c243de4170dd1be127ef54c79977081fea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#! /bin/bash
cp cibic compile_data/
cp lib.s compile_data/
cd compile_data/
for f in *.c
do
    echo $f
    ./cibic $f > mips.s 2> /dev/null
    gcc $f -m32 -std=c99 2> /dev/null
    ./spim -stat -file mips.s > out
    ./a.out > std
    diff std out
    if [[ "$?" != 0 ]]; then
        echo "Wrong Answer!"
        break;
    fi
done
echo "OK."