* src/mcs51/ralloc.c (spillThis, spilSomething): fixed bug 2435941
[fw/sdcc] / support / regression / tests / bug2435941.c
diff --git a/support/regression/tests/bug2435941.c b/support/regression/tests/bug2435941.c
new file mode 100644 (file)
index 0000000..1300857
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+    bug 2435941
+*/
+
+#include <testfwk.h>
+#include <stdint.h>
+
+uint32_t sleep_timer_get(void)
+{
+       return 0x12345678;
+}
+
+int32_t remaining;
+uint32_t updated;
+uint32_t now;
+
+// no need to call this, it generates compiler error:
+//   error 9: FATAL Compiler Internal Error
+static void do_test(void) reentrant
+{
+  while (1)
+    {
+      now = sleep_timer_get();
+
+      remaining -= (now - updated) & 0xFF;
+      updated = now;
+    }
+}
+
+void
+testBug(void)
+{
+       ASSERT(1);
+}