]> git.sur5r.net Git - cc65/blob - test/ref/cc65090726.c
fb4773afb1715d34101f76ab36958e8e5da5ecbe
[cc65] / test / ref / cc65090726.c
1 /*
2   !!DESCRIPTION!! 
3   !!ORIGIN!!      testsuite
4   !!LICENCE!!     Public Domain
5   !!AUTHOR!!
6 */
7
8 struct Record {
9   struct Record *PtrComp;
10   int x;
11 };
12
13 typedef struct Record RecordType;
14 typedef RecordType *RecordPtr;
15
16 void Proc3(RecordPtr *PtrParOut)
17 {
18         /* whatever */
19 }
20
21 void Proc1(RecordPtr PtrParIn)
22 {
23 #define  NextRecord  (*(PtrParIn->PtrComp))
24         Proc3((RecordPtr *)NextRecord.PtrComp);
25         Proc3(&NextRecord.PtrComp);
26         Proc3(&PtrParIn->PtrComp->PtrComp);
27
28 #ifdef CAST_STRUCT_PTR
29         Proc3((RecordPtr *) PtrParIn->PtrComp->PtrComp);
30         Proc3((RecordPtr *) (*(PtrParIn->PtrComp)).PtrComp);
31         Proc3((RecordPtr *) NextRecord.PtrComp);
32 #else
33         Proc3(PtrParIn->PtrComp->PtrComp);
34         Proc3((*(PtrParIn->PtrComp)).PtrComp);
35         Proc3(NextRecord.PtrComp);
36 #endif
37         
38 #undef   NextRecord
39 }
40
41 int main(void)
42 {
43     printf("it works :)\n");
44
45     return 0;
46 }