aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-03-15 12:05:57 +0100
committerCyril SIX <cyril.six@kalray.eu>2018-04-04 16:30:07 +0200
commitf677664f63ca17c0a514c449f62ad958b5f9eb68 (patch)
tree689f66543dc81e413abe053d475b8c947e421abd /test/mppa
parent74ce642ef4e223ef02369c290ca1625b7b7f912c (diff)
downloadcompcert-kvx-f677664f63ca17c0a514c449f62ad958b5f9eb68.tar.gz
compcert-kvx-f677664f63ca17c0a514c449f62ad958b5f9eb68.zip
MPPA - The project compiles.
Supports very simple programs that load integer immediates. It starts the main, loads integer in registers, and return correctly. Addition in Mach not yet supported, but should not be hard to add them. Function calls are not yet supported. The ABI for now is the same as the RiscV, with a small twist: $ra is first loaded in a user register, then this user register is pushed (instead of pushing $ra straight away).
Diffstat (limited to 'test/mppa')
-rw-r--r--test/mppa/Makefile26
-rw-r--r--test/mppa/simple.c6
2 files changed, 32 insertions, 0 deletions
diff --git a/test/mppa/Makefile b/test/mppa/Makefile
new file mode 100644
index 00000000..6481af5e
--- /dev/null
+++ b/test/mppa/Makefile
@@ -0,0 +1,26 @@
+ELF=simple.bin
+DEBUG:=$(if $(DEBUG),"-dall",)
+
+all: $(ELF)
+
+%.bin: %.s
+ k1-gcc $< -o $@
+
+.SECONDARY:
+%.s: %.c
+ ccomp $(DEBUG) -v -S $< -o $@
+
+.PHONY:
+clean:
+ rm -f *.alloctrace
+ rm -f *.cm
+ rm -f *.compcert.c
+ rm -f *.i
+ rm -f *.light.c
+ rm -f *.ltl
+ rm -f *.mach
+ rm -f *.parsed.c
+ rm -f *.rtl.?
+ rm -f *.s
+ rm -rf profile/
+ rm -f $(ELF)
diff --git a/test/mppa/simple.c b/test/mppa/simple.c
new file mode 100644
index 00000000..5a54b3d8
--- /dev/null
+++ b/test/mppa/simple.c
@@ -0,0 +1,6 @@
+int main(void){
+ int a = 4;
+ int b = 3;
+
+ return (a+b);
+}