source: src/tests/functions.c@ 6e49f18

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 6e49f18 was 5ead9f9, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

add copyright notice to test files

  • Property mode set to 100644
File size: 3.0 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// functions.c --
8//
9// Author : Peter A. Buhr
10// Created On : Wed Aug 17 08:39:58 2016
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Wed Aug 17 08:40:52 2016
13// Update Count : 1
14//
15
16// ANSI function definitions
17
18void h(void) {}
19
20int f (
21 int (void),
22 int (int),
23 int ((void)),
24 int ((int)),
25 void g(void)
26 ) {
27 (*g)();
28 g();
29 g = h;
30}
31
32int f1() {}
33int (f2()) {}
34int (*f3())() {}
35int *((f4())) {}
36int ((*f5()))() {}
37int *f6() {}
38int *(f7)() {}
39int **f8() {}
40int * const *(f9)() {}
41int (*f10())[] {}
42int (*f11())[][3] {}
43int ((*f12())[])[3] {}
44
45// "implicit int" otype specifier (not ANSI)
46
47fII1( int i ) {}
48const fII2( int i ) {}
49extern fII3( int i ) {}
50extern const fII4( int i ) {}
51
52*fII5() {}
53const *fII6() {}
54const long *fII7() {}
55static const long *fII8() {}
56const static long *fII9() {}
57
58// K&R function definitions
59
60fO1( i ) int i; {}
61int fO2( i ) int i; {}
62const fO3( i ) int i; {}
63extern fO4( i ) int i; {}
64extern const fO5( i ) int i; {}
65
66// Cforall extensions
67
68[] f( );
69[int] f( );
70[] f(int);
71[int] f(int);
72[] f( ) {}
73[int] f( ) {}
74[] f(int) {}
75[int] f(int) {}
76
77[int x] f( );
78[] f(int x);
79[int x] f(int x);
80[int x] f( ) {}
81[] f(int x) {}
82[int x] f(int x) {}
83
84[int, int x] f( );
85[] f(int, int x);
86[int, int x] f(int, int x);
87[int, int x] f( ) {}
88[] f(int, int x) {}
89[int, int x] f(int, int x) {}
90
91[int, int x, int] f( );
92[] f(int, int x, int);
93[int, int x, int] f(int, int x, int);
94[int, int x, int] f( ) {}
95[] f(int, int x, int) {}
96[int, int x, int] f(int, int x, int) {}
97
98[int, int x, * int y] f( );
99[] f(int, int x, * int y);
100[int, int x, * int y] f(int, int x, * int y);
101[int, int x, * int y] f( ) {}
102[] f(int, int x, * int y) {}
103[int, int x, * int y] f(int, int x, * int y) {}
104
105[ int ] f11( int ), f12; // => int f11( int ), f12( int );
106
107[int] f(
108 int ( int, int p ),
109 [int](int)
110 ) {
111 int (*(*p)[][10])[][3];
112 * [][10] * [][3] int p;
113 * [] * [int](int) p;
114}
115
116static const int *f1() {}
117static [ const int ] f2() {}
118static inline [ const * int ] f3() {}
119static inline [ const [ * int, int ] ] f4() {}
120static [ const [ * int, const int ] ] f5() {}
121
122// unnamed parameter
123
124int f(
125 int (),
126
127 int *(),
128 int **(),
129 int * const *(),
130 int * const * const (),
131
132 int ([]),
133 int ([10]),
134
135 int *([]),
136 int *([10]),
137 int **([]),
138 int **([10]),
139 int * const *([]),
140 int * const *([10]),
141 int * const * const ([]),
142 int * const * const ([10])
143 );
144
145int f(
146 int (),
147
148 int *(),
149 int **(),
150 int * const *(),
151 int * const * const (),
152
153 int ([]),
154 int ([10]),
155
156 int *([]),
157 int *([10]),
158 int **([]),
159 int **([10]),
160 int * const *([]),
161 int * const *([10]),
162 int * const * const ([]),
163 int * const * const ([10])
164 ) {
165}
166
167typedef int T;
168
169int f( T (*f), T t ) {
170 T (T);
171}
172
173// errors
174
175//int f()[] {}
176//int (f[])() {}
177//int f[]() {}
178//int ((*f15())())[] {}
179
180// Local Variables: //
181// tab-width: 4 //
182// compile-command: "cfa functions.c" //
183// End: //
Note: See TracBrowser for help on using the repository browser.