From: Bernhard Urban Date: Sun, 6 Mar 2011 14:46:58 +0000 (+0000) Subject: arm: init X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=testub10.git;a=commitdiff_plain;h=5277c3e4cdff1f9f870df6e41de55f3d1988d695 arm: init basically you can use the ppc testcases (since i use 32 bit here as well) --- diff --git a/gesamt_arm/codea_abgabe_a.0 b/gesamt_arm/codea_abgabe_a.0 new file mode 100644 index 0000000..8c3fc2a --- /dev/null +++ b/gesamt_arm/codea_abgabe_a.0 @@ -0,0 +1,3 @@ +method m(x) + return x-this; +end; diff --git a/gesamt_arm/codea_abgabe_a.call b/gesamt_arm/codea_abgabe_a.call new file mode 100644 index 0000000..dfe2827 --- /dev/null +++ b/gesamt_arm/codea_abgabe_a.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(2,5)==3 && m(7,2)==-5); diff --git a/gesamt_arm/codea_abgabe_a.instr b/gesamt_arm/codea_abgabe_a.instr new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/gesamt_arm/codea_abgabe_a.instr @@ -0,0 +1 @@ +6 diff --git a/gesamt_arm/codea_abgabe_aa.0 b/gesamt_arm/codea_abgabe_aa.0 new file mode 100644 index 0000000..3ef30f4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_aa.0 @@ -0,0 +1,3 @@ +method m() + return this; +end; diff --git a/gesamt_arm/codea_abgabe_aa.call b/gesamt_arm/codea_abgabe_aa.call new file mode 100644 index 0000000..84b8a6d --- /dev/null +++ b/gesamt_arm/codea_abgabe_aa.call @@ -0,0 +1,2 @@ +extern long m(long); +RET(m(5)==5 && m(9)==9); diff --git a/gesamt_arm/codea_abgabe_aa.instr b/gesamt_arm/codea_abgabe_aa.instr new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_aa.instr @@ -0,0 +1 @@ +4 diff --git a/gesamt_arm/codea_abgabe_ab.0 b/gesamt_arm/codea_abgabe_ab.0 new file mode 100644 index 0000000..930c6b4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ab.0 @@ -0,0 +1,3 @@ +method m(x y z) + return z; +end; diff --git a/gesamt_arm/codea_abgabe_ab.call b/gesamt_arm/codea_abgabe_ab.call new file mode 100644 index 0000000..73ec7db --- /dev/null +++ b/gesamt_arm/codea_abgabe_ab.call @@ -0,0 +1,2 @@ +extern long m(long,long,long,long); +RET(m(1,2,3,5)==5 && m(3,2,1,9)==9); diff --git a/gesamt_arm/codea_abgabe_ab.instr b/gesamt_arm/codea_abgabe_ab.instr new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ab.instr @@ -0,0 +1 @@ +4 diff --git a/gesamt_arm/codea_abgabe_ac.0 b/gesamt_arm/codea_abgabe_ac.0 new file mode 100644 index 0000000..245811f --- /dev/null +++ b/gesamt_arm/codea_abgabe_ac.0 @@ -0,0 +1,3 @@ +method m(x) + return not this; +end; diff --git a/gesamt_arm/codea_abgabe_ac.call b/gesamt_arm/codea_abgabe_ac.call new file mode 100644 index 0000000..3a00483 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ac.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(0,12)==1 && m(9,13)==0); diff --git a/gesamt_arm/codea_abgabe_ac.instr b/gesamt_arm/codea_abgabe_ac.instr new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ac.instr @@ -0,0 +1 @@ +8 diff --git a/gesamt_arm/codea_abgabe_ad.0 b/gesamt_arm/codea_abgabe_ad.0 new file mode 100644 index 0000000..dd86b6e --- /dev/null +++ b/gesamt_arm/codea_abgabe_ad.0 @@ -0,0 +1,3 @@ +method m(x) + return -5; +end; diff --git a/gesamt_arm/codea_abgabe_ad.call b/gesamt_arm/codea_abgabe_ad.call new file mode 100644 index 0000000..e341dfc --- /dev/null +++ b/gesamt_arm/codea_abgabe_ad.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(0,12)==-5 && m(9,13)==-5); diff --git a/gesamt_arm/codea_abgabe_ad.instr b/gesamt_arm/codea_abgabe_ad.instr new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ad.instr @@ -0,0 +1 @@ +4 diff --git a/gesamt_arm/codea_abgabe_ae.0 b/gesamt_arm/codea_abgabe_ae.0 new file mode 100644 index 0000000..380147c --- /dev/null +++ b/gesamt_arm/codea_abgabe_ae.0 @@ -0,0 +1,3 @@ +method m(x) + return x--3; +end; diff --git a/gesamt_arm/codea_abgabe_ae.call b/gesamt_arm/codea_abgabe_ae.call new file mode 100644 index 0000000..248ce1c --- /dev/null +++ b/gesamt_arm/codea_abgabe_ae.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(0,12)==15 && m(9,13)==16); diff --git a/gesamt_arm/codea_abgabe_ae.instr b/gesamt_arm/codea_abgabe_ae.instr new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ae.instr @@ -0,0 +1 @@ +4 diff --git a/gesamt_arm/codea_abgabe_af.0 b/gesamt_arm/codea_abgabe_af.0 new file mode 100644 index 0000000..500f66a --- /dev/null +++ b/gesamt_arm/codea_abgabe_af.0 @@ -0,0 +1,3 @@ +method m(x) + return x*this*x*this; +end; diff --git a/gesamt_arm/codea_abgabe_af.call b/gesamt_arm/codea_abgabe_af.call new file mode 100644 index 0000000..94f6da0 --- /dev/null +++ b/gesamt_arm/codea_abgabe_af.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(2,3)==36 && m(5,-7)==35*35); diff --git a/gesamt_arm/codea_abgabe_af.instr b/gesamt_arm/codea_abgabe_af.instr new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/gesamt_arm/codea_abgabe_af.instr @@ -0,0 +1 @@ +10 diff --git a/gesamt_arm/codea_abgabe_ag.0 b/gesamt_arm/codea_abgabe_ag.0 new file mode 100644 index 0000000..3d524dd --- /dev/null +++ b/gesamt_arm/codea_abgabe_ag.0 @@ -0,0 +1,3 @@ +method m(x) + return this or x; +end; diff --git a/gesamt_arm/codea_abgabe_ag.call b/gesamt_arm/codea_abgabe_ag.call new file mode 100644 index 0000000..85b9ba2 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ag.call @@ -0,0 +1,2 @@ +extern long m(long,long); +RET(m(3,9)==11 && m(6,13)==15); diff --git a/gesamt_arm/codea_abgabe_ag.instr b/gesamt_arm/codea_abgabe_ag.instr new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/gesamt_arm/codea_abgabe_ag.instr @@ -0,0 +1 @@ +6 diff --git a/gesamt_arm/codea_abgabe_ah.0 b/gesamt_arm/codea_abgabe_ah.0 new file mode 100644 index 0000000..970e37c --- /dev/null +++ b/gesamt_arm/codea_abgabe_ah.0 @@ -0,0 +1,3 @@ +method m(x) + return x Eingabe von $i:" + cat $i + echo + RESFILE=test${beispiel}out$$ + $PROGRAM <$i >$RESFILE + retval=$? + echo -n "Übersetzung: " + if test $retval -eq 0 + then + echo "Status korrekt" + else + echo "[Errot] Status=$retval. Erwartet: 0" + let errorfound=1 + fi + echo + echo "Ausgabe:" + #if [ -f ~/test/scripts/clr.py ]; then + # cat $RESFILE | ~/test/scripts/clr.py + #else + cat $RESFILE + #fi + mv -f $RESFILE $RESFILE.s + CALLFILE=${i%.*}.call + echo + if [ ! -f $CALLFILE ]; then + echo "Fehler: Datei $CALLFILE existiert nicht, kann Code nicht ausführen..." + exit 1 + else + echo "Übersetze und linke das Testprogramm:" + if cc -g -I. -DCALL=\"$CALLFILE\" $LOC/testmain.c $LOC/callingconvention.o $RESFILE.s; then + echo + echo "Rufe folgendes Codefragment auf:" + cat $CALLFILE + echo + ./a.out + retval=$? + # test callee saved registers + if [ "$retval" -ge 12 ] && [ "$retval" -le 15 ]; then + echo "[Error] Callee-saved register %r$retval modified." + let errorfound=1 + elif [ "$retval" -eq 11 ]; then + echo "[Error] Callee-saved register %rbx modified." + let errorfound=1 + elif [ "$retval" -eq 16 ]; then + echo "[Error] Callee-saved register %rbp modified." + let errorfound=1 + elif [ "$retval" -eq 30 ]; then + echo "[Error] Stack pointer %rsp modified." + let errorfound=1 + else + # test signals + test $retval -gt 127 + retsig=$? + test ${i##*.} = xin + expsig=$? + if test $retsig -eq $expsig; then + if test $retval -eq 1; then + echo "[Error] Das Ergebnis des Aufrufs ist falsch." + let errorfound=1 + elif test $retval -eq 0; then + echo "Das Ergebnis des Ausdrucks ist korrekt." + else + echo "[Error] Erzeugter Code verhaelt sich bzgl. Signalerzeugung anders als erwartet." + let errorfound=1 + fi + else + echo "[Error] Erzeugter Code verhaelt sich bezueglich Signalerzeugung anders als erwartet." + let errorfound=1 + echo "Rueckgabewert = $retval"; + fi + fi + echo + else + echo "[Error] Erzeugter Code konnte nicht assembliert und gelinkt werden." + let errorfound=1 + fi + fi + let errnum=errnum+errorfound + if [ 1 -eq $errorfound ]; then + rm *.s + rm *.out + exit 3; + fi + rm -f a.out $RESFILE $RESFILE.s + fi +done + +for i in $LOC/*.[123] $LOC2/*.[123] +do + if [ -f $i ]; then + let prgnum=prgnum+1 + echo "==========> Eingabe von $i:" + cat $i + echo + echo "Ausgabe:" + $PROGRAM <$i + retval=$? + if test $retval -eq ${i#*.} + then + echo "Status: korrekt" + else + echo "[Error] Status: $retval. Erwartet: ${i#*.}" + let errnum=errnum+1 + exit 3; + fi + echo +fi +done +let corrnum=prgnum-errnum +echo "Statistics: " +echo "===========" +echo " $prgnum Tests total" +echo " $corrnum Tests passed" +echo " $errnum Tests failed"