Imported Upstream version 2.9.0
[debian/cc1111] / src / regression / string1.c
1 #include "gpsim_assert.h"
2 #include "picregs.h"
3
4 unsigned char failures=0;
5 //unsigned bit bit1;
6
7 typedef unsigned char byte;
8
9
10 byte uchar0;
11 const byte arr[] = { 1,2,8,9,0 };
12
13 void
14 done()
15 {
16   ASSERT(MANGLE(failures) == 0);
17   PASSED();
18 }
19
20 void  isr(void) interrupt 1 using 1
21 {
22
23   if(arr[3]!=9)
24     failures++;
25   PORTB = 7;
26 }
27
28 void lcd1(const unsigned char *str)
29 {
30   const char *p = "hello world!\r\n";
31
32   if(!str)
33     failures++;
34
35  if(str && str[2] != 'r')
36     failures++;
37
38   if(arr[3]!=9)
39     failures++;
40
41   while (1) {
42     if (0 == *p) break;
43     PORTB = *p;
44     p++;
45   }
46
47 }
48
49 void main(void)
50 {
51   lcd1("str");
52   done();
53 }