diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2018-04-09 13:55:44 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2018-04-09 13:55:44 +0200 |
commit | e20c07dddf528ce50951a59cb92f98b4bca8da77 (patch) | |
tree | 1c923b35023d0d12004f86680db97e99aa836819 /test/mppa | |
parent | a724c959659d94425b8dd4a0dc2e343ecdba3edc (diff) | |
download | compcert-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/Makefile | 2 | ||||
-rw-r--r-- | test/mppa/general/branchz.c | 12 | ||||
-rw-r--r-- | test/mppa/general/branchzu.c | 12 | ||||
-rw-r--r-- | test/mppa/general/output/branchz.exp | 1 | ||||
-rw-r--r-- | test/mppa/general/output/branchzu.exp | 1 |
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 |