use elf as ext
This commit is contained in:
parent
4e591092db
commit
b4dbce76cf
9 changed files with 31 additions and 61 deletions
10
test.sh
10
test.sh
|
@ -1,13 +1,13 @@
|
|||
cd test
|
||||
gcc ../boot.c
|
||||
gcc ../boot.c -o boot.elf
|
||||
all=0
|
||||
succ=0
|
||||
for i in *.c; do
|
||||
all=$((all+1))
|
||||
i=$(basename $i .c)
|
||||
./a.out < $i.c > $i.s &&
|
||||
riscv64-linux-gnu-gcc-12 -static $i.s -o $i.c.out &&
|
||||
qemu-riscv64 $i.c.out < $i.in > $i.ans
|
||||
./boot.elf < $i.c > $i.s &&
|
||||
riscv64-linux-gnu-gcc-12 -static $i.s -o $i.elf &&
|
||||
qemu-riscv64 $i.elf < $i.in > $i.ans
|
||||
echo $? >> $i.ans
|
||||
if cmp $i.out $i.ans; then
|
||||
succ=$((succ+1))
|
||||
|
@ -19,4 +19,4 @@ for i in *.c; do
|
|||
fi
|
||||
done
|
||||
echo "Passed $succ/$all tests"
|
||||
rm *.c.out a.out
|
||||
rm *.elf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue