diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2018-04-26 11:36:02 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2018-04-26 11:36:02 +0200 |
commit | 432bff5418d4789ba4187ffdd6ce89a29d58962a (patch) | |
tree | 6c48ff6aa5919fe8d5804302d48b5900a2c4441c /test/mppa | |
parent | fd0562ffa499e57eff1243b5d9defe94a3f91d3c (diff) | |
download | compcert-kvx-432bff5418d4789ba4187ffdd6ce89a29d58962a.tar.gz compcert-kvx-432bff5418d4789ba4187ffdd6ce89a29d58962a.zip |
MPPA - Added a lot more unit tests + refined coverage
Diffstat (limited to 'test/mppa')
46 files changed, 240 insertions, 2 deletions
diff --git a/test/mppa/Makefile b/test/mppa/Makefile index d1b732d8..ffea4c30 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 div2 +TESTNAMES=$(notdir $(subst .c,,$(wildcard $(DIR)/*.c))) CCOMP=../../ccomp #TESTS=$(addprefix $(DIR)/,$(TESTNAMES)) diff --git a/test/mppa/asm_coverage b/test/mppa/asm_coverage -Subproject 88898ab230e813d5d03dc901ba4b906d2ef6bbb +Subproject 63195a533f3a7f93e8e8ebad0683b176041e09d diff --git a/test/mppa/coverage_helper.py b/test/mppa/coverage_helper.py index f886264c..b086aca9 100644 --- a/test/mppa/coverage_helper.py +++ b/test/mppa/coverage_helper.py @@ -24,7 +24,7 @@ for inst in occurs: pruned_occurs[inst_no_a + "." + mod] = 1 elif inst_no_a in ("cb"): del pruned_occurs[inst] - for mod in ("wnez", "weqz", "wltz", "wgez", "wlez", "wgtz", "dnez", + for mod in ("wnez", "weqz", "wltz", "wgez", "wlez", "wgtz", "deqz", "dnez", "dltz", "dgez", "dlez", "dgtz"): pruned_occurs[inst_no_a + "." + mod] = 1 else: diff --git a/test/mppa/general/addw.c b/test/mppa/general/addw.c new file mode 100644 index 00000000..842b0de7 --- /dev/null +++ b/test/mppa/general/addw.c @@ -0,0 +1,5 @@ +int main(void){ + int a = 5; + int b = -3; + return a+b; +} diff --git a/test/mppa/general/andd.c b/test/mppa/general/andd.c new file mode 100644 index 00000000..57c23585 --- /dev/null +++ b/test/mppa/general/andd.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 5; + long long b = -3; + return a&b; +} diff --git a/test/mppa/general/andw.c b/test/mppa/general/andw.c new file mode 100644 index 00000000..a10f1203 --- /dev/null +++ b/test/mppa/general/andw.c @@ -0,0 +1,5 @@ +int main(void){ + int a = 5; + int b = -3; + return a&b; +} diff --git a/test/mppa/general/cb.deqz.c b/test/mppa/general/cb.deqz.c new file mode 100644 index 00000000..c4f639fd --- /dev/null +++ b/test/mppa/general/cb.deqz.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 != a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.dgez.c b/test/mppa/general/cb.dgez.c new file mode 100644 index 00000000..3d1caf1e --- /dev/null +++ b/test/mppa/general/cb.dgez.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 > a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.dgtz.c b/test/mppa/general/cb.dgtz.c new file mode 100644 index 00000000..9c0c9ea2 --- /dev/null +++ b/test/mppa/general/cb.dgtz.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 >= a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.dlez.c b/test/mppa/general/cb.dlez.c new file mode 100644 index 00000000..021bb16d --- /dev/null +++ b/test/mppa/general/cb.dlez.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (a > 0) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.dltz.c b/test/mppa/general/cb.dltz.c new file mode 100644 index 00000000..d6c59d03 --- /dev/null +++ b/test/mppa/general/cb.dltz.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (a >= 0) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.dnez.c b/test/mppa/general/cb.dnez.c new file mode 100644 index 00000000..99ecf84e --- /dev/null +++ b/test/mppa/general/cb.dnez.c @@ -0,0 +1,9 @@ +#define TYPE long long + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 == a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.wgez.c b/test/mppa/general/cb.wgez.c new file mode 100644 index 00000000..8226c397 --- /dev/null +++ b/test/mppa/general/cb.wgez.c @@ -0,0 +1,9 @@ +#define TYPE int + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 > a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.wgtz.c b/test/mppa/general/cb.wgtz.c new file mode 100644 index 00000000..005e552b --- /dev/null +++ b/test/mppa/general/cb.wgtz.c @@ -0,0 +1,9 @@ +#define TYPE int + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (0 >= a) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.wlez.c b/test/mppa/general/cb.wlez.c new file mode 100644 index 00000000..4393003b --- /dev/null +++ b/test/mppa/general/cb.wlez.c @@ -0,0 +1,9 @@ +#define TYPE int + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (a > 0) + return 42; + return 0; +} diff --git a/test/mppa/general/cb.wltz.c b/test/mppa/general/cb.wltz.c new file mode 100644 index 00000000..76d49f56 --- /dev/null +++ b/test/mppa/general/cb.wltz.c @@ -0,0 +1,9 @@ +#define TYPE int + +int main(void){ + TYPE a = 6; + TYPE b = -4; + if (a >= 0) + return 42; + return 0; +} diff --git a/test/mppa/general/compd.eq.c b/test/mppa/general/compd.eq.c new file mode 100644 index 00000000..9b3e3a0d --- /dev/null +++ b/test/mppa/general/compd.eq.c @@ -0,0 +1,4 @@ +int main(void){ + long long a = 5, b = -2; + return (a == b); +} diff --git a/test/mppa/general/compd.geu.c b/test/mppa/general/compd.geu.c new file mode 100644 index 00000000..d168a6a7 --- /dev/null +++ b/test/mppa/general/compd.geu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned long long a = 5, b = -2; + return (a >= b); +} diff --git a/test/mppa/general/compd.gt.c b/test/mppa/general/compd.gt.c new file mode 100644 index 00000000..768e57fc --- /dev/null +++ b/test/mppa/general/compd.gt.c @@ -0,0 +1,4 @@ +int main(void){ + long long a = 5, b = -2; + return (a > b); +} diff --git a/test/mppa/general/compd.gtu.c b/test/mppa/general/compd.gtu.c new file mode 100644 index 00000000..5ac1910a --- /dev/null +++ b/test/mppa/general/compd.gtu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned long long a = 5, b = -2; + return (a > b); +} diff --git a/test/mppa/general/compd.le.c b/test/mppa/general/compd.le.c new file mode 100644 index 00000000..b493f661 --- /dev/null +++ b/test/mppa/general/compd.le.c @@ -0,0 +1,4 @@ +int main(void){ + long long a = 5, b = -2; + return (a <= b); +} diff --git a/test/mppa/general/compd.leu.c b/test/mppa/general/compd.leu.c new file mode 100644 index 00000000..8bb640b1 --- /dev/null +++ b/test/mppa/general/compd.leu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned long long a = 5, b = -2; + return (a <= b); +} diff --git a/test/mppa/general/compd.lt.c b/test/mppa/general/compd.lt.c new file mode 100644 index 00000000..04a92556 --- /dev/null +++ b/test/mppa/general/compd.lt.c @@ -0,0 +1,4 @@ +int main(void){ + long long a = 5, b = -2; + return (a < b); +} diff --git a/test/mppa/general/compd.ltu.c b/test/mppa/general/compd.ltu.c new file mode 100644 index 00000000..bbd901f6 --- /dev/null +++ b/test/mppa/general/compd.ltu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned long long a = 5, b = -2; + return (a < b); +} diff --git a/test/mppa/general/compd.ne.c b/test/mppa/general/compd.ne.c new file mode 100644 index 00000000..01c52254 --- /dev/null +++ b/test/mppa/general/compd.ne.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned long long a = 5, b = -2; + return (a != b); +} diff --git a/test/mppa/general/compw.eq.c b/test/mppa/general/compw.eq.c new file mode 100644 index 00000000..f030d86b --- /dev/null +++ b/test/mppa/general/compw.eq.c @@ -0,0 +1,4 @@ +int main(void){ + int a = 5, b = -2; + return (a == b); +} diff --git a/test/mppa/general/compw.geu.c b/test/mppa/general/compw.geu.c new file mode 100644 index 00000000..866f0b47 --- /dev/null +++ b/test/mppa/general/compw.geu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned int a = 5, b = -2; + return (a >= b); +} diff --git a/test/mppa/general/compw.gt.c b/test/mppa/general/compw.gt.c new file mode 100644 index 00000000..6cde8622 --- /dev/null +++ b/test/mppa/general/compw.gt.c @@ -0,0 +1,4 @@ +int main(void){ + int a = 5, b = -2; + return (a > b); +} diff --git a/test/mppa/general/compw.gtu.c b/test/mppa/general/compw.gtu.c new file mode 100644 index 00000000..b2e74594 --- /dev/null +++ b/test/mppa/general/compw.gtu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned int a = 5, b = -2; + return (a > b); +} diff --git a/test/mppa/general/compw.le.c b/test/mppa/general/compw.le.c new file mode 100644 index 00000000..8f33e064 --- /dev/null +++ b/test/mppa/general/compw.le.c @@ -0,0 +1,4 @@ +int main(void){ + int a = 5, b = -2; + return (a <= b); +} diff --git a/test/mppa/general/compw.leu.c b/test/mppa/general/compw.leu.c new file mode 100644 index 00000000..fde558eb --- /dev/null +++ b/test/mppa/general/compw.leu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned int a = 5, b = -2; + return (a <= b); +} diff --git a/test/mppa/general/compw.lt.c b/test/mppa/general/compw.lt.c new file mode 100644 index 00000000..f3bc5a65 --- /dev/null +++ b/test/mppa/general/compw.lt.c @@ -0,0 +1,4 @@ +int main(void){ + int a = 5, b = -2; + return (a < b); +} diff --git a/test/mppa/general/compw.ltu.c b/test/mppa/general/compw.ltu.c new file mode 100644 index 00000000..5e396085 --- /dev/null +++ b/test/mppa/general/compw.ltu.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned int a = 5, b = -2; + return (a < b); +} diff --git a/test/mppa/general/compw.ne.c b/test/mppa/general/compw.ne.c new file mode 100644 index 00000000..28eb627e --- /dev/null +++ b/test/mppa/general/compw.ne.c @@ -0,0 +1,4 @@ +int main(void){ + unsigned int a = 5, b = -2; + return (a != b); +} diff --git a/test/mppa/general/lbs.c b/test/mppa/general/lbs.c new file mode 100644 index 00000000..17441fd2 --- /dev/null +++ b/test/mppa/general/lbs.c @@ -0,0 +1,5 @@ +int main(void){ + char s[] = "Tom and Jerry at the playa\n"; + int a = s[10]; + return a; +} diff --git a/test/mppa/general/lbz.c b/test/mppa/general/lbz.c new file mode 100644 index 00000000..ca4e076f --- /dev/null +++ b/test/mppa/general/lbz.c @@ -0,0 +1,5 @@ +int main(void){ + unsigned char s[] = "Tom and Jerry at the playa\n"; + int a = s[10]; + return a; +} diff --git a/test/mppa/general/muld.c b/test/mppa/general/muld.c new file mode 100644 index 00000000..7893f714 --- /dev/null +++ b/test/mppa/general/muld.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 3, b = -4; + long long c = a*b; + return c; +} diff --git a/test/mppa/general/mulw.c b/test/mppa/general/mulw.c new file mode 100644 index 00000000..36e3abb1 --- /dev/null +++ b/test/mppa/general/mulw.c @@ -0,0 +1,5 @@ +int main(void){ + int a = 3, b = -4; + int c = a*b; + return c; +} diff --git a/test/mppa/general/negd.c b/test/mppa/general/negd.c new file mode 100644 index 00000000..3a949389 --- /dev/null +++ b/test/mppa/general/negd.c @@ -0,0 +1,6 @@ +int main(void){ + long long a = 5; + long long b = -2; + long long c = -a; + return c; +} diff --git a/test/mppa/general/ord.c b/test/mppa/general/ord.c new file mode 100644 index 00000000..f87061dd --- /dev/null +++ b/test/mppa/general/ord.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 3, b = -4; + long long c = a|b; + return c; +} diff --git a/test/mppa/general/sbfd.c b/test/mppa/general/sbfd.c new file mode 100644 index 00000000..503c65c7 --- /dev/null +++ b/test/mppa/general/sbfd.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 3, b = -4; + long long c = a-b; + return c; +} diff --git a/test/mppa/general/sbfw.c b/test/mppa/general/sbfw.c new file mode 100644 index 00000000..2607159f --- /dev/null +++ b/test/mppa/general/sbfw.c @@ -0,0 +1,5 @@ +int main(void){ + int a = 3, b = -4; + int c = a-b; + return c; +} diff --git a/test/mppa/general/sllw.c b/test/mppa/general/sllw.c new file mode 100644 index 00000000..98ecde3a --- /dev/null +++ b/test/mppa/general/sllw.c @@ -0,0 +1,5 @@ +int main(void){ + int a = 3, b = -4; + int c = a << b; + return c; +} diff --git a/test/mppa/general/srad.c b/test/mppa/general/srad.c new file mode 100644 index 00000000..1c0ea20b --- /dev/null +++ b/test/mppa/general/srad.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 3, b = -4; + long long c = a >> b; + return c; +} diff --git a/test/mppa/general/srld.c b/test/mppa/general/srld.c new file mode 100644 index 00000000..78861790 --- /dev/null +++ b/test/mppa/general/srld.c @@ -0,0 +1,5 @@ +int main(void){ + unsigned long long a = 3, b = -4; + unsigned long long c = a >> b; + return c; +} diff --git a/test/mppa/general/xord.c b/test/mppa/general/xord.c new file mode 100644 index 00000000..ab0ba653 --- /dev/null +++ b/test/mppa/general/xord.c @@ -0,0 +1,5 @@ +int main(void){ + long long a = 3, b = -4; + long long c = a^b; + return c; +} |