From: Michael Beck Date: Thu, 13 Sep 2007 13:41:47 +0000 (+0000) Subject: more cases added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=2e4275711e10fc88208957e6c252f93c298ad713;p=libfirm more cases added [r15786] --- diff --git a/ir/be/test/localopts.c b/ir/be/test/localopts.c index f9e4bf40d..3d8ca0c65 100644 --- a/ir/be/test/localopts.c +++ b/ir/be/test/localopts.c @@ -43,6 +43,38 @@ int sub3(int x, int y) return -x - y; } +int cmp1(int x, int y) { + return -x == -y; +} + +int cmp2(int x, int y) { + return -x != -y; +} + +int cmp3(int x, int y) { + return ~x == ~y; +} + +int cmp4(int x, int y) { + return ~x != ~y; +} + +int cmp5(int x, int y, int z) { + return x + z == z + y; +} + +int cmp6(int x, int y, int z) { + return x + z != y + z; +} + +int cmp7(int x, int y, int z) { + return x - z == y - z; +} + +int cmp8(int x, int y, int z) { + return z -x != z - y; +} + int main(void) { #define TU(func,x,expect) \ @@ -60,4 +92,12 @@ int main(void) TB(sub1, 23, 17, -691); TB(sub2, 42, 17, 59); TB(sub3, 42, 17, -59); + TB(cmp1, 42, 17, 0); + TB(cmp2, 42, 17, 1); + TB(cmp3, 42, 17, 0); + TB(cmp4, 42, 17, 1); + TT(cmp5, 42, 17, -4, 0); + TT(cmp6, 42, 17, -4, 1); + TT(cmp7, 42, 17, -4, 0); + TT(cmp8, 42, 17, -4, 1); }