1 /*
2    bug2889032.c
3  */
4 
5 #include <testfwk.h>
6 
7 struct timetable_timestamp {
8   const char *id;
9 };
10 
11 struct timetable {
12   struct timetable_timestamp *timestamps;
13   unsigned int * const ptr;
14 };
15 
16 // no need to call this, it generates compiler error:
17 //   Assertion failed: 0, file sdcc/src/SDCCopt.c, line 707
timetable_timediff(struct timetable * t,const char * id1)18 int timetable_timediff(struct timetable *t, const char *id1)
19 {
20   int i;
21 
22   for(i = *t->ptr - 1; i >= 0; --i)
23   {
24     if(t->timestamps[i].id == id1)
25     {
26       return i;
27     }
28   }
29 
30   return 0;
31 }
32 
33 void
testBug(void)34 testBug (void)
35 {
36 	ASSERT (1);
37 }
38