diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2018-04-25 13:37:53 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2018-04-25 13:37:53 +0200 |
commit | 28db3119a6fef8a6ef487b414f7851a065db0889 (patch) | |
tree | a2396a794c7e0090e79c31295975ef5dfd2b6a17 | |
parent | 31d718c4b7fc81eced145de585b371bd01d3fabc (diff) | |
download | compcert-kvx-28db3119a6fef8a6ef487b414f7851a065db0889.tar.gz compcert-kvx-28db3119a6fef8a6ef487b414f7851a065db0889.zip |
MPPA - Added test for division int by 2
-rw-r--r-- | test/mppa/Makefile | 2 | ||||
-rw-r--r-- | test/mppa/general/div2.c | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/mppa/Makefile b/test/mppa/Makefile index faeb7c62..b210efaf 100644 --- a/test/mppa/Makefile +++ b/test/mppa/Makefile @@ -1,7 +1,7 @@ DIR=general BINDIR=bin ASMDIR=asm -TESTNAMES=simple call branch for forvar forvarl branchz branchzu +TESTNAMES=simple call branch for forvar forvarl branchz branchzu div2 CCOMP=../../ccomp #TESTS=$(addprefix $(DIR)/,$(TESTNAMES)) diff --git a/test/mppa/general/div2.c b/test/mppa/general/div2.c new file mode 100644 index 00000000..ec73b32d --- /dev/null +++ b/test/mppa/general/div2.c @@ -0,0 +1,22 @@ +#define SIZE 10 + +int main(void){ + int a[SIZE], b[SIZE], c[SIZE]; + int i; + + for (i = 0 ; i < SIZE ; i++){ + a[i] = i-5; + b[i] = -i+2; + c[i] = (a[i] + b[i]) / 2; + } + /* a = {-5, -4, .., 5} + * b = { 2, 1, .., -8} + */ + + for (i = 0 ; i < SIZE ; i++) + if (c[i] != -1) + return c[i]; + + return 42; +} +/* RETURN VALUE: 42 */ |