aboutsummaryrefslogtreecommitdiffstats
path: root/test/mppa
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2018-04-09 13:55:44 +0200
committerCyril SIX <cyril.six@kalray.eu>2018-04-09 13:55:44 +0200
commite20c07dddf528ce50951a59cb92f98b4bca8da77 (patch)
tree1c923b35023d0d12004f86680db97e99aa836819 /test/mppa
parenta724c959659d94425b8dd4a0dc2e343ecdba3edc (diff)
downloadcompcert-kvx-e20c07dddf528ce50951a59cb92f98b4bca8da77.tar.gz
compcert-kvx-e20c07dddf528ce50951a59cb92f98b4bca8da77.zip
MPPA - Optimized branch generation for word compare to 0
Diffstat (limited to 'test/mppa')
-rw-r--r--test/mppa/Makefile2
-rw-r--r--test/mppa/general/branchz.c12
-rw-r--r--test/mppa/general/branchzu.c12
-rw-r--r--test/mppa/general/output/branchz.exp1
-rw-r--r--test/mppa/general/output/branchzu.exp1
5 files changed, 27 insertions, 1 deletions
diff --git a/test/mppa/Makefile b/test/mppa/Makefile
index 60433f03..36bd49bc 100644
--- a/test/mppa/Makefile
+++ b/test/mppa/Makefile
@@ -1,5 +1,5 @@
DIR=general
-TESTNAMES=simple call branch for forvar forvarl
+TESTNAMES=simple call branch for forvar forvarl branchz branchzu
TESTS=$(addprefix $(DIR)/,$(TESTNAMES))
ELF=$(addsuffix .bin,$(TESTS))
diff --git a/test/mppa/general/branchz.c b/test/mppa/general/branchz.c
new file mode 100644
index 00000000..5e3226d5
--- /dev/null
+++ b/test/mppa/general/branchz.c
@@ -0,0 +1,12 @@
+int main(void){
+ int a=1;
+ int b;
+
+ if(a==0){
+ b = a+4;
+ } else {
+ b = a+2;
+ }
+
+ return b;
+}
diff --git a/test/mppa/general/branchzu.c b/test/mppa/general/branchzu.c
new file mode 100644
index 00000000..0ff25763
--- /dev/null
+++ b/test/mppa/general/branchzu.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/output/branchz.exp b/test/mppa/general/output/branchz.exp
new file mode 100644
index 00000000..00750edc
--- /dev/null
+++ b/test/mppa/general/output/branchz.exp
@@ -0,0 +1 @@
+3
diff --git a/test/mppa/general/output/branchzu.exp b/test/mppa/general/output/branchzu.exp
new file mode 100644
index 00000000..00750edc
--- /dev/null
+++ b/test/mppa/general/output/branchzu.exp
@@ -0,0 +1 @@
+3