source: trunk/testcase/570c.c@ 594

Last change on this file since 594 was 594, checked in by bird, 22 years ago

Initial testcase.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1typedef struct some_struct_pointer * PTYPE;
2
3/*
4 * Function and method declarations.
5 * Checks mangling.
6 */
7/* No underscore, No mangling. */
8void _System Void(void);
9void * _System PVoid(void);
10int _System Int(void);
11PTYPE _System PType(void);
12
13/*
14 * Typedefs.
15 * Checks that there is not warnings on these.
16 */
17typedef void _System Typedef1Void(void);
18typedef void * _System Typedef1PVoid(void);
19typedef int _System Typedef1Int(void);
20typedef PTYPE _System Typedef1PType(void);
21
22typedef void (_System Typedef2Void)(void);
23typedef void * (_System Typedef2PVoid)(void);
24typedef int (_System Typedef2Int)(void);
25typedef PTYPE (_System Typedef2PType)(void);
26
27typedef void (* _System PTypedef1Void)(void);
28typedef void * (* _System PTypedef1PVoid)(void);
29typedef int (* _System PTypedef1Int)(void);
30typedef PTYPE (* _System PTypedef1PType)(void);
31
32typedef void (_System * PTypedef2Void)(void);
33typedef void * (_System * PTypedef2PVoid)(void);
34typedef int (_System * PTypedef2Int)(void);
35typedef PTYPE (_System * PTypedef2PType)(void);
36
37
38/*
39 * Structures.
40 */
41typedef struct VFT
42{
43 void (_System * PStructMemberVoid)(void* pvThis);
44 void * (_System * PStructMemberPVoid)(void* pvThis);
45 int (_System * PStructMemberInt)(void* pvThis);
46 PTYPE (_System * PStructMemberPType)(void* pvThis);
47} VFT, *PVFT;
48
49
50int DoC(void)
51{
52 VFT vft = {0,0,0,0};
53
54 Void();
55 PVoid();
56 Int();
57 PType();
58
59 if (vft.PStructMemberVoid)
60 vft.PStructMemberVoid(&vft);
61 if (vft.PStructMemberPVoid)
62 vft.PStructMemberPVoid(&vft);
63 if (vft.PStructMemberInt)
64 vft.PStructMemberInt(&vft);
65 if (vft.PStructMemberPType)
66 vft.PStructMemberPType(&vft);
67
68 return 0;
69}
70
Note: See TracBrowser for help on using the repository browser.