From 02eb94c0eed9dde87d6f1a120e1a87127b567457 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 5 Sep 2007 13:40:13 +0000 Subject: [PATCH] test the new mul with Const [r15672] --- ir/be/test/mulconst.c | 24 +++++++++++++++++++++ ir/be/test/mulconst.h | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 ir/be/test/mulconst.c create mode 100644 ir/be/test/mulconst.h diff --git a/ir/be/test/mulconst.c b/ir/be/test/mulconst.c new file mode 100644 index 000000000..ac4d5a16f --- /dev/null +++ b/ir/be/test/mulconst.c @@ -0,0 +1,24 @@ +/** + * check all kinds of multiplication with constants + */ + +#define test_C(C) \ +int test_##C(int i) { \ + return i * C; \ +} +#define test_N(C) \ +int test_m##C(int i) { \ + return i * -C; \ +} +#include "mulconst.h" +#undef test_C +#undef test_N + +#define test_C(C) printf("%d\n", test_##C(x)); +#define test_N(C) printf("%d\n", test_m##C(x)); + +int x = 1; + +int main() { +#include "mulconst.h" +} diff --git a/ir/be/test/mulconst.h b/ir/be/test/mulconst.h new file mode 100644 index 000000000..040d1c094 --- /dev/null +++ b/ir/be/test/mulconst.h @@ -0,0 +1,49 @@ +/** + * check all kinds of multiplication with constants + */ +test_N(1) +test_N(2) +test_N(3) +test_N(4) +test_N(5) +test_N(6) +test_N(7) +test_N(8) +test_N(9) +test_N(10) +test_N(11) +test_N(12) +test_N(13) +test_N(14) +test_N(15) +test_N(16) +test_N(17) +test_N(18) +test_N(19) +test_N(20) +test_C(0) +test_C(1) +test_C(2) +test_C(3) +test_C(4) +test_C(5) +test_C(6) +test_C(7) +test_C(8) +test_C(9) +test_C(10) +test_C(11) +test_C(12) +test_C(13) +test_C(14) +test_C(15) +test_C(16) +test_C(17) +test_C(18) +test_C(19) +test_C(20) +test_C(27) +test_C(81) +test_C(1560) +test_C(46347) +test_C(348435) -- 2.20.1