source: tests/functions.cfa @ 97c3159

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since 97c3159 was dc8511c, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

first attempt at updating suffixes for test programs

  • Property mode set to 100644
File size: 3.3 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.cfa --
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 : Tue Nov  6 17:54:09 2018
13// Update Count     : 13
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// function prototypes
106
107[ int ] f11( int ), f12();  // => int f11( int ), f12( void );
108
109const double bar1(), bar2( int ), bar3( double );               // C version
110[const double] foo(), foo( int ), foo( double ) { return 3.0; } // CFA version
111struct S { int i; };
112[S] rtn( int ) {}
113
114
115[int] f(
116        int ( int, int p ),
117        [int](int)
118        ) {
119        int (* (* pc)[][10])[][3];
120        * [][10] * [][3] int p;
121        * [] * [int](int) p;
122}
123
124static const int * f1() {}
125static [ * const int ] f2() {}
126static inline [ const * int ] f3() {}
127static inline [ const [ * int, int ] ] f4() {}
128static [ const [ * int, const int ] ] f5() {}
129
130// unnamed parameter
131
132int f(
133        int (),
134
135        int * (),
136        int ** (),
137        int * const * (),
138        int * const * const (),
139
140        int ([]),
141        int ([10]),
142
143        int * ([]),
144        int * ([10]),
145        int ** ([]),
146        int ** ([10]),
147        int * const * ([]),
148        int * const * ([10]),
149        int * const * const ([]),
150        int * const * const ([10])
151        );
152
153int f(
154        int (),
155
156        int * (),
157        int ** (),
158        int * const * (),
159        int * const * const (),
160
161        int ([]),
162        int ([10]),
163
164        int * ([]),
165        int * ([10]),
166        int ** ([]),
167        int ** ([10]),
168        int * const * ([]),
169        int * const * ([10]),
170        int * const * const ([]),
171        int * const * const ([10])
172        ) {
173}
174
175typedef int T;
176
177int f( T (* f), T t ) {
178        T (T);
179}
180
181// errors
182
183//int f()[] {}
184//int (f[])() {}
185//int f[]() {}
186//int ((* f15())())[] {}
187
188// Local Variables: //
189// tab-width: 4 //
190// compile-command: "cfa functions.cfa" //
191// End: //
Note: See TracBrowser for help on using the repository browser.