Added test case for Rotl node.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Tue, 19 Aug 2008 18:56:16 +0000 (18:56 +0000)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Tue, 19 Aug 2008 18:56:16 +0000 (18:56 +0000)
[r21270]

ir/be/test/rot.c [new file with mode: 0644]

diff --git a/ir/be/test/rot.c b/ir/be/test/rot.c
new file mode 100644 (file)
index 0000000..72aa2b2
--- /dev/null
@@ -0,0 +1,12 @@
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+       printf("Result: %d (should be 42)\n", rot(21,1));
+
+       return 0;
+}
+
+unsigned rot(unsigned x, unsigned y)
+{
+       return x << y | x >> (32-y);
+}