demonstrates an error in ShrsLs lowering
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 7 Jun 2008 17:51:41 +0000 (17:51 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 7 Jun 2008 17:51:41 +0000 (17:51 +0000)
[r20020]

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

diff --git a/ir/be/test/fehler113.c b/ir/be/test/fehler113.c
new file mode 100644 (file)
index 0000000..82d2149
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
+#define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b))))
+#define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b))))
+
+/* This is NOT folded into a ROL, but demonstrates an error in old lowering */
+long long testLL(long long a) {
+       return ROL(a,3);
+}
+
+int main() {
+       int printf(const char *fmt, ...);
+
+       printf("%lld\n", testLL(1));
+       return 0;
+}