From: Andreas Zwinkau Date: Mon, 11 Aug 2008 13:04:01 +0000 (+0000) Subject: two more test cases concering Convs and Divs X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=ab9ffbc440b0193c27ce918b762b1a8d9b67d2d0;p=libfirm two more test cases concering Convs and Divs [r21089] --- diff --git a/ir/be/test/divs.c b/ir/be/test/divs.c new file mode 100644 index 000000000..965cc3763 --- /dev/null +++ b/ir/be/test/divs.c @@ -0,0 +1,26 @@ +int x = 42; +int y = 10; + +int signed_div(int x, int y) { + printf("%d (should be 4)\n", x / y); + printf("%d (should be 2)\n", x % y); + return (x / y) + (x % y); +} + +unsigned int unsigned_div(unsigned int x, unsigned int y) { + printf("%u (should be 4)\n", x / y); + printf("%u (should be 2)\n", x % y); + return (x / y) + (x % y); +} + +double f_div(double x, double y) { + printf("%f (should be 4.2)\n", x / y); + return (x / y); +} + +int main(void) { + int x = signed_div(42, 10) + + unsigned_div(42, 10) + + f_div(42.0, 10.0); + return 16-x; +} diff --git a/ir/be/test/most_complex_conv.c b/ir/be/test/most_complex_conv.c new file mode 100644 index 000000000..afe309d33 --- /dev/null +++ b/ir/be/test/most_complex_conv.c @@ -0,0 +1,7 @@ +unsigned int MAX_INT = 4294967295; + +int main(void) { + double res = MAX_INT; + printf("Res: %f\n", res); + return 0; +}