Regression file for testing the nested for-loop bug in the PIC port that Steve Tell...
[fw/sdcc] / src / regression / string1.c
index 27f9c7ae92cfc279a8c4decc3f3145fc129b73be..51d547629db43f4f54b9c1bbbacd95a569454496 100644 (file)
@@ -1,10 +1,12 @@
+#define __16F873
+#include "p16f873.h"
 unsigned char success=0;
 unsigned char failures=0;
 unsigned char dummy=0;
 //unsigned bit bit1;
 
 typedef unsigned char byte;
-data at 0x06 unsigned char  PORTB;
+
 
 byte uchar0;
 const byte arr[] = { 1,2,8,9,0 };
@@ -29,11 +31,23 @@ void  isr(void) interrupt 1 using 1
 
 void lcd1(const unsigned char *str)
 {
-  if(str && str[2] != 'r')
+  const char *p = "hello world!\r\n";
+
+  if(!str)
+    failures++;
+
+ if(str && str[2] != 'r')
     failures++;
 
   if(arr[3]!=9)
     failures++;
+
+  while (1) {
+    if (0 == *p) break;
+    PORTB = *p;
+    p++;
+  }
+
 }
 
 void main(void)