bug in the tarval modul ...
[libfirm] / ir / be / test / fehler57.c
index 459a7b7..9dc2aca 100644 (file)
@@ -1,12 +1,24 @@
 int floor_log2_wide (unsigned int x)
 {
-       int log = -1;
-       while (x != 0)
-               log++, x >>= 1;
-       return log;
+       x >>= 1;
+       return x;
 }
 
+unsigned test_div(int x) {
+  x /= -1;
+  return x;
+}
+
+int X;
+
 int main()
 {
        printf("Res: %d\n", floor_log2_wide(4294967251));
+       printf("Res: %d\n", test_div(-5));
+        printf("Res: %d\n", -5%-1);
+        printf("Res: %d\n", +5%-1);
+        printf("Res: %d\n", -5%+1);
+        printf("Res: %d\n", +5%+1);
+        printf("Res: %d\n", X % -1);
+        return 0;
 }