aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa/general
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-04-05 11:53:42 +0200
committerCyril SIX <cyril.six@kalray.eu>2018-04-05 11:53:42 +0200
commitebf476c1c9bebaf9b108302ed4c1a5a8da0243a3 (patch)
treeea193458b9f3f0c96ec59acb690f4cf3493d1fa0 /test/mppa/general
parentbe6796ea9e15f543606191bd6a26281ba37421ab (diff)
downloadcompcert-kvx-ebf476c1c9bebaf9b108302ed4c1a5a8da0243a3.tar.gz
compcert-kvx-ebf476c1c9bebaf9b108302ed4c1a5a8da0243a3.zip
MPPA - Added regression tests
Diffstat (limited to 'test/mppa/general')
-rw-r--r--test/mppa/general/branch.c12
-rw-r--r--test/mppa/general/call.c16
-rw-r--r--test/mppa/general/for.c9
-rw-r--r--test/mppa/general/forvar.c10
-rw-r--r--test/mppa/general/forvarl.c11
-rw-r--r--test/mppa/general/output/branch.bin.exp1
-rw-r--r--test/mppa/general/output/call.bin.exp1
-rw-r--r--test/mppa/general/output/for.bin.exp1
-rw-r--r--test/mppa/general/output/forvar.bin.exp1
-rw-r--r--test/mppa/general/output/forvarl.bin.exp1
-rw-r--r--test/mppa/general/output/simple.bin.exp1
-rw-r--r--test/mppa/general/simple.c6
12 files changed, 70 insertions, 0 deletions
diff --git a/test/mppa/general/branch.c b/test/mppa/general/branch.c
new file mode 100644
index 00000000..dee15568
--- /dev/null
+++ b/test/mppa/general/branch.c
@@ -0,0 +1,12 @@
+int main(void){
+ int a=1;
+ int b;
+
+ if(a){
+ b = a+4;
+ } else {
+ b = a+2;
+ }
+
+ return b;
+}
diff --git a/test/mppa/general/call.c b/test/mppa/general/call.c
new file mode 100644
index 00000000..3f58b756
--- /dev/null
+++ b/test/mppa/general/call.c
@@ -0,0 +1,16 @@
+int sum(int a, int b){
+ return a + b;
+}
+
+int make_42(void){
+ return 42;
+}
+
+int make_18(void){
+ return 18;
+}
+
+int main(void){
+ return sum(make_42(), make_18());
+ //return make_42() + make_18();
+}
diff --git a/test/mppa/general/for.c b/test/mppa/general/for.c
new file mode 100644
index 00000000..6a3a6cc8
--- /dev/null
+++ b/test/mppa/general/for.c
@@ -0,0 +1,9 @@
+int main(void){
+ int a = 4;
+ int i;
+
+ for (i = 0 ; i < 12 ; i++)
+ a++;
+
+ return a;
+}
diff --git a/test/mppa/general/forvar.c b/test/mppa/general/forvar.c
new file mode 100644
index 00000000..1a075734
--- /dev/null
+++ b/test/mppa/general/forvar.c
@@ -0,0 +1,10 @@
+int main(void){
+ int i;
+ int a = 4;
+ int b = 12;
+
+ for (i = 0 ; i < b ; i++)
+ a++;
+
+ return a;
+}
diff --git a/test/mppa/general/forvarl.c b/test/mppa/general/forvarl.c
new file mode 100644
index 00000000..90de7411
--- /dev/null
+++ b/test/mppa/general/forvarl.c
@@ -0,0 +1,11 @@
+int main(void)
+{
+ long long int a = 42;
+ long long int b = 84;
+ long long int i;
+
+ for (i = 0 ; i < a ; i++)
+ b++;
+
+ return 0;
+}
diff --git a/test/mppa/general/output/branch.bin.exp b/test/mppa/general/output/branch.bin.exp
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/test/mppa/general/output/branch.bin.exp
@@ -0,0 +1 @@
+5
diff --git a/test/mppa/general/output/call.bin.exp b/test/mppa/general/output/call.bin.exp
new file mode 100644
index 00000000..abdfb053
--- /dev/null
+++ b/test/mppa/general/output/call.bin.exp
@@ -0,0 +1 @@
+60
diff --git a/test/mppa/general/output/for.bin.exp b/test/mppa/general/output/for.bin.exp
new file mode 100644
index 00000000..b6a7d89c
--- /dev/null
+++ b/test/mppa/general/output/for.bin.exp
@@ -0,0 +1 @@
+16
diff --git a/test/mppa/general/output/forvar.bin.exp b/test/mppa/general/output/forvar.bin.exp
new file mode 100644
index 00000000..b6a7d89c
--- /dev/null
+++ b/test/mppa/general/output/forvar.bin.exp
@@ -0,0 +1 @@
+16
diff --git a/test/mppa/general/output/forvarl.bin.exp b/test/mppa/general/output/forvarl.bin.exp
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/mppa/general/output/forvarl.bin.exp
@@ -0,0 +1 @@
+0
diff --git a/test/mppa/general/output/simple.bin.exp b/test/mppa/general/output/simple.bin.exp
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/test/mppa/general/output/simple.bin.exp
@@ -0,0 +1 @@
+7
diff --git a/test/mppa/general/simple.c b/test/mppa/general/simple.c
new file mode 100644
index 00000000..725aff68
--- /dev/null
+++ b/test/mppa/general/simple.c
@@ -0,0 +1,6 @@
+int main(void){
+ int a = 4;
+ int b = 3;
+
+ return (a+b);
+}