From: Michael Beck Date: Wed, 10 Oct 2007 10:55:09 +0000 (+0000) Subject: more test added X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=44abfa87e3140fd0f934ff14227d6091546c3f3a;p=libfirm more test added [r16136] --- diff --git a/ir/be/test/localopts.c b/ir/be/test/localopts.c index ef02a73c0..90dd27689 100644 --- a/ir/be/test/localopts.c +++ b/ir/be/test/localopts.c @@ -99,6 +99,22 @@ int and3(int a) { return (a & 2) == 2; } +int and4(int a) { + return (a & 2) == 4; +} + +int and5(int a) { + return (a & 2) != 4; +} + +int or1(int a) { + return (a | 2) != 0; +} + +int or2(int a) { + return (a | 7) == 0; +} + int add1(int x) { return x + ~x; } @@ -151,6 +167,18 @@ int shrs4(int a) { return (a >> 3) == (1 << 29); } +int conv1(signed char a) { + return (int)a < 0; +} + +int conv2(unsigned char a) { + return (int)a > 0; +} + +int conv3(signed char a) { + return (unsigned)a != 0; +} + int main(void) { #define TU(func,x,expect) \ @@ -199,4 +227,11 @@ int main(void) TU(shrs3, -5<<3, 1); TU(shrs3, -6<<3, 0); TU(shrs4, 5, 0); + TU(conv1, 3, 0); + TU(conv2, 3, 1); + TU(conv3, 3, 1); + TU(and4, 7, 0); + TU(and5, 7, 1); + TU(or1, 7, 1); + TU(or2, 7, 0); }