struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug2823963.c
blob719104e50531c15b9a7a53c0550d76a09f13a0d6
1 /*
2 bug2823963.c
3 */
5 #include <testfwk.h>
7 typedef struct xLIST_ITEM
9 unsigned short xItemValue;
10 volatile struct xLIST_ITEM * pxNext;
11 volatile struct xLIST_ITEM * pxPrevious;
12 void * pvOwner;
13 void * pvContainer;
14 }xListItem;
16 typedef struct xMINI_LIST_ITEM
18 unsigned short xItemValue;
19 volatile struct xLIST_ITEM *pxNext;
20 volatile struct xLIST_ITEM *pxPrevious;
21 }xMiniListItem;
23 typedef struct xLIST
25 volatile unsigned char uxNumberOfItems;
26 volatile xListItem * pxIndex;
27 volatile xMiniListItem xListEnd;
28 } xList;
30 static xList xDelayedTaskList1;
32 void vListInitialise( xList *pxList )
34 pxList->pxIndex = ( xListItem * ) &( pxList->xListEnd );
37 void
38 testBug(void)
40 void * p = &xDelayedTaskList1.xListEnd;
41 vListInitialise( &xDelayedTaskList1 );
42 ASSERT (xDelayedTaskList1.pxIndex == p);