* support/regression/fwk/lib/testfwk.c (__printf): Removed GENERIC.
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 2 Oct 2001 01:10:42 +0000 (01:10 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 2 Oct 2001 01:10:42 +0000 (01:10 +0000)
* support/regression/tests/bug-467035.c: Created.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1341 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/regression/fwk/lib/testfwk.c
support/regression/tests/bug-467035.c [new file with mode: 0644]

index 8a46780e6fb1c9f1a5f4f205c7ca15c576ecd0bf..9f013c2d2db33b7498e7337ac3a62d4005a32512 100644 (file)
@@ -66,7 +66,7 @@ void __printf(const char *szFormat, ...) REENTRANT
         if (*szFormat == '%') {
             switch (*++szFormat) {
             case 's': {
-                char GENERIC *sz = va_arg(ap, char GENERIC *);
+                char *sz = va_arg(ap, char *);
                 while (*sz) {
                     _putchar(*sz++);
                 }
diff --git a/support/regression/tests/bug-467035.c b/support/regression/tests/bug-467035.c
new file mode 100644 (file)
index 0000000..dc65895
--- /dev/null
@@ -0,0 +1,57 @@
+/* Tests a bug in for loops where b in plot_point is always 1.
+   Stripped down from the gbdk filltest.c
+ */
+#include <testfwk.h>
+
+typedef unsigned char UBYTE;
+
+UBYTE 
+getpix(UBYTE x, UBYTE y)
+{
+  UNUSED(x);
+  UNUSED(y);
+
+  return 0;
+}
+
+void 
+color(UBYTE a, UBYTE b, UBYTE c)
+{
+  UNUSED(a & b & c);
+}
+
+void 
+line(UBYTE a, UBYTE b, UBYTE c, UBYTE d)
+{
+  UNUSED(a & b & c & d);
+}
+
+void 
+plot_point(UBYTE a, UBYTE b)
+{
+  static UBYTE ea, eb;
+
+  ASSERT(b == eb);
+  ASSERT(a == ea);
+
+  ea++;
+  if (ea > 12) {
+    ea = 0;
+    eb++;
+  }
+  LOG(("(a, b) -> (%u, %u)\n", (unsigned int)a, (unsigned int)b));
+}
+
+void
+testForMerge(void)
+{
+  UBYTE  a,b;
+
+  for (b=0; b<=10U; b++) {
+    for (a=0; a<=12U; a++) {
+      color(getpix(a,b+1), 0, 1);
+      plot_point(a,b);
+    }
+    color(0, 0, 1);
+  }
+}