struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug2889032.c
blobcc5fa33db86bcec7f179b267b3ec7531cae3e115
1 /*
2 bug2889032.c
3 */
5 #include <testfwk.h>
7 struct timetable_timestamp {
8 const char *id;
9 };
11 struct timetable {
12 struct timetable_timestamp *timestamps;
13 unsigned int * const ptr;
16 // no need to call this, it generates compiler error:
17 // Assertion failed: 0, file sdcc/src/SDCCopt.c, line 707
18 int timetable_timediff(struct timetable *t, const char *id1)
20 int i;
22 for(i = *t->ptr - 1; i >= 0; --i)
24 if(t->timestamps[i].id == id1)
26 return i;
30 return 0;
33 void
34 testBug (void)
36 ASSERT (1);