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

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

'Completed' the testcase.

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
RevLine 
[594]1typedef struct some_struct_pointer * PTYPE;
2
3/*
4 * Function and method declarations.
5 * Checks mangling.
6 */
7/* No underscore, No mangling. */
[599]8void _System Void(int a, int b, int c, int d);
9void * _System PVoid(int a, int b, int c, int d);
10int _System Int(int a, int b, int c, int d);
11PTYPE _System PType(int a, int b, int c, int d);
[594]12
13/*
14 * Typedefs.
15 * Checks that there is not warnings on these.
16 */
[599]17typedef void _System Typedef1Void(int a, int b, int c, int d);
18typedef void * _System Typedef1PVoid(int a, int b, int c, int d);
19typedef int _System Typedef1Int(int a, int b, int c, int d);
20typedef PTYPE _System Typedef1PType(int a, int b, int c, int d);
[594]21
[599]22typedef void (_System Typedef2Void)(int a, int b, int c, int d);
23typedef void * (_System Typedef2PVoid)(int a, int b, int c, int d);
24typedef int (_System Typedef2Int)(int a, int b, int c, int d);
25typedef PTYPE (_System Typedef2PType)(int a, int b, int c, int d);
[594]26
[599]27typedef void (* _System PTypedef1Void)(int a, int b, int c, int d);
28typedef void * (* _System PTypedef1PVoid)(int a, int b, int c, int d);
29typedef int (* _System PTypedef1Int)(int a, int b, int c, int d);
30typedef PTYPE (* _System PTypedef1PType)(int a, int b, int c, int d);
[594]31
[595]32/* Alternate writing which should have the same effect I think... */
[599]33typedef void (_System * PTypedef2Void)(int a, int b, int c, int d);
34typedef void * (_System * PTypedef2PVoid)(int a, int b, int c, int d);
35typedef int (_System * PTypedef2Int)(int a, int b, int c, int d);
36typedef PTYPE (_System * PTypedef2PType)(int a, int b, int c, int d);
[594]37
38
39/*
40 * Structures.
41 */
42typedef struct VFT
43{
[599]44 void (_System * PStructMemberVoid)(int a, int b, int c, int d);
45 void * (_System * PStructMemberPVoid)(int a, int b, int c, int d);
46 int (_System * PStructMemberInt)(int a, int b, int c, int d);
47 PTYPE (_System * PStructMemberPType)(int a, int b, int c, int d);
[595]48
49 /* Alternate writing which should have the same effect I think... */
[599]50 void ( _System * PStructMember2Void)(int a, int b, int c, int d);
51 void * ( _System * PStructMember2PVoid)(int a, int b, int c, int d);
52 int ( _System * PStructMember2Int)(int a, int b, int c, int d);
53 PTYPE ( _System * PStructMember2PType)(int a, int b, int c, int d);
[595]54
[594]55} VFT, *PVFT;
56
57
[599]58int DoC(int a, int b, int c, int d)
[594]59{
[599]60 VFT vft = {Void, PVoid, Int, PType,
61 Void, PVoid, Int, PType};
[594]62
[599]63 Typedef1Void * pfnTypedef1Void = Void;
64 Typedef1PVoid * pfnTypedef1PVoid = PVoid;
65 Typedef1Int * pfnTypedef1Int = Int;
66 Typedef1PType * pfnTypedef1PType = PType;
[594]67
[599]68 Typedef2Void * pfnTypedef2Void = Void;
69 Typedef2PVoid * pfnTypedef2PVoid = PVoid;
70 Typedef2Int * pfnTypedef2Int = Int;
71 Typedef2PType * pfnTypedef2PType = PType;
[594]72
[599]73 PTypedef1Void pfnPTypedef1Void = Void;
74 PTypedef1PVoid pfnPTypedef1PVoid = PVoid;
75 PTypedef1Int pfnPTypedef1Int = Int;
76 PTypedef1PType pfnPTypedef1PType = PType;
77
78 PTypedef2Void pfnPTypedef2Void = Void;
79 PTypedef2PVoid pfnPTypedef2PVoid = PVoid;
80 PTypedef2Int pfnPTypedef2Int = Int;
81 PTypedef2PType pfnPTypedef2PType = PType;
82
83
84 /* extern functions */
85 Void(1,2,3,4);
86 PVoid(1,2,3,4);
87 Int(1,2,3,4);
88 PType(1,2,3,4);
89
90 /* typedefs */
91 pfnTypedef1Void(1,2,3,4);
92 pfnTypedef1PVoid(1,2,3,4);
93 pfnTypedef1Int(1,2,3,4);
94 pfnTypedef1PType(1,2,3,4);
95
96 pfnTypedef2Void(1,2,3,4);
97 pfnTypedef2PVoid(1,2,3,4);
98 pfnTypedef2Int(1,2,3,4);
99 pfnTypedef2PType(1,2,3,4);
100
101 pfnPTypedef1Void(1,2,3,4);
102 pfnPTypedef1PVoid(1,2,3,4);
103 pfnPTypedef1Int(1,2,3,4);
104 pfnPTypedef1PType(1,2,3,4);
105
106 pfnPTypedef2Void(1,2,3,4);
107 pfnPTypedef2PVoid(1,2,3,4);
108 pfnPTypedef2Int(1,2,3,4);
109 pfnPTypedef2PType(1,2,3,4);
110
111
112 /* structs */
113 vft.PStructMemberVoid(1,2,3,4);
114 vft.PStructMemberPVoid(1,2,3,4);
115 vft.PStructMemberInt(1,2,3,4);
116 vft.PStructMemberPType(1,2,3,4);
117
118 vft.PStructMember2Void(1,2,3,4);
119 vft.PStructMember2PVoid(1,2,3,4);
120 vft.PStructMember2Int(1,2,3,4);
121 vft.PStructMember2PType(1,2,3,4);
122
[594]123 return 0;
124}
125
Note: See TracBrowser for help on using the repository browser.