Reworked unit tests for machine and renamed test_programs directory

This commit is contained in:
François Autin
2023-03-12 00:22:16 +01:00
parent 177abfe846
commit c75e2995e7
29 changed files with 24 additions and 48 deletions

View File

@ -0,0 +1,6 @@
TOPDIR = ../..
include $(TOPDIR)/Makefile.tests
dumps: unsigned_addition.dump unsigned_division.dump unsigned_multiplication.dump unsigned_substraction.dump
tests: unsigned_addition.guac unsigned_division.guac unsigned_multiplication.guac unsigned_substraction.guac

View File

@ -0,0 +1,15 @@
# Simple arithmetics program
These allow to check whether the following instructions are correctly implemented.
- addi
- sd
- sw
- li
- sw
- lw
- mv
- addw
- nop
- ld
- ret

View File

@ -0,0 +1,9 @@
#include "userlib/syscall.h"
#include "userlib/libnachos.h"
// EXPECTS TWO VARIABLES WITH A VALUE OF UNSIGNED 1
int main() {
unsigned int x = 0;
unsigned int y = 1;
x = x + y;
}

View File

@ -0,0 +1,6 @@
// Expecting two variables with a value of two
int main() {
unsigned int x = 4;
unsigned int y = 2;
x = x / y;
}

View File

@ -0,0 +1,6 @@
// EXPECTS TWO VARIABLES WITH A VALUE OF UNSIGNED 2
int main() {
unsigned int x = 1;
unsigned int y = 2;
x = x * y;
}

View File

@ -0,0 +1,6 @@
// EXPECTS TWO VARIABLES WITH A VALUE OF UNSIGNED 1
int main() {
unsigned int x = 1;
unsigned int y = 1;
x = x - y;
}