source: tests/variableDeclarator.cfa @ 10b5970

Last change on this file since 10b5970 was 2853d6f, checked in by Michael Brooks <mlbrooks@…>, 3 weeks ago

Remove uses of warnings to show test success. Eliminate simple causes of other warnings from affected tests and remove the result from WFLAG_OPT_LAX.

Many affected tests also formerly used -fsyntax-only to avoid errors at later compilation stages, or at runtime. Repair such tests to actually work though runtime, and remove them from SYNTAX_ONLY_CODE.

Group tests listed under WFLAGS_OPT according to why they should receive lax treatment. Add reason WFLGAS_OPT_LAX_EXPECT_WARN and give the original list reason WFLGAS_OPT_LAX_TO_INVESTIGATE.

Tests whose purpose is to show a warning are listed as both SYNTAX_ONLY_CODE (so that the warning is the output) and WFLGAS_OPT_LAX_EXPECT_WARN (to document this fact).

  • Property mode set to 100644
File size: 3.7 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// variableDeclarator.cfa --
8//
9// Author           : Peter A. Buhr
10// Created On       : Wed Aug 17 08:41:42 2016
11// Last Modified By : Peter A. Buhr
12// Last Modified On : Sat Jun  5 10:08:47 2021
13// Update Count     : 14
14//
15
16// Variable declarations test
17int f1;
18int (f2);
19
20int * f3;
21int ** f4;
22int * const * f5;
23int * const * const f6;
24
25int * (f7);
26int ** (f8);
27int * const * (f9);
28int * const * const (f10);
29
30int (* f11);
31int (** f12);
32int (* const * f13);
33int (* const * const f14);
34
35int f15[0];
36int f16[10];
37int (f17[0]);
38int (f18[10]);
39
40int * f19[0];
41int * f20[10];
42int ** f21[0];
43int ** f22[10];
44int * const * f23[0];
45int * const * f24[10];
46int * const * const f25[0];
47int * const * const f26[10];
48
49int *(f27[0]);
50int *(f28[10]);
51int **(f29[0]);
52int **(f30[10]);
53int * const *(f31[0]);
54int * const *(f32[10]);
55int * const * const (f33[0]);
56int * const * const (f34[10]);
57
58int (* f35)[];
59int (* f36)[10];
60int (** f37)[];
61int (** f38)[10];
62int (* const * f39)[];
63int (* const * f40)[10];
64int (* const * const f41)[];
65int (* const * const f42)[10];
66
67int f43[0][3];
68int f44[3][3];
69int (f45[0])[3];
70int (f46[3])[3];
71int ((f47[0]))[3];
72int ((f48[3]))[3];
73
74int * f49[0][3];
75int * f50[3][3];
76int ** f51[0][3];
77int ** f52[3][3];
78int * const * f53[0][3];
79int * const * f54[3][3];
80int * const * const f55[0][3];
81int * const * const f56[3][3];
82
83int (* f57[0][3]);
84int (* f58[3][3]);
85int (** f59[0][3]);
86int (** f60[3][3]);
87int (* const * f61[0][3]);
88int (* const * f62[3][3]);
89int (* const * const f63[0][3]);
90int (* const * const f64[3][3]);
91
92int f65(int);
93int (f66)(int);
94
95#pragma GCC diagnostic push
96#pragma GCC diagnostic ignored "-Wignored-qualifiers"
97
98int * f67(int);
99int ** f68(int);
100int * const * f69(int);
101int * const * const f70(int);
102
103int *(f71)(int);
104int **(f72)(int);
105int * const *(f73)(int);
106
107int * const * const (f74)(int);
108
109int (* f75)(int);
110int (** f76)(int);
111int (* const * f77)(int);
112int (* const * const f78)(int);
113
114int (*(* f79)(int))();
115int (*(* const f80)(int))();
116int (* const(* const f81)(int))();
117
118#pragma GCC diagnostic pop
119
120// errors
121
122//int fe0[]();                          // array of functions
123//int (fe1[])();                                // array of functions
124//int fe2()[];                          // returning an array
125//int fe3()();                          // returning a function
126//int (* fe4)()();                              // returning a function
127//int ((* fe5())())[];                  // returning an array
128
129#ifdef __CFA__
130// Cforall extensions
131
132* int cf3;
133* * int cf4;
134* const * int cf5;
135const * const * int cf6;
136
137[0] int cf15;
138[10] int cf16;
139
140[0] * int cf19;
141[10] * int cf20;
142int ** cf21[0];
143[10] * * int cf22;
144[0] * const * int cf23;
145[10] * const * int cf24;
146[0] const * const * int cf25;
147[10] const * const * int cf26;
148
149* [] int cf35;
150* [10] int cf36;
151* * [] int cf37;
152* * [10] int cf38;
153* const * [] int cf39;
154* const * [10] int cf40;
155const * const * [] int cf41;
156const * const * [10] int cf42;
157
158[0][3] int cf43;
159[3][3] int cf44;
160
161[0][3] * int cf49;
162[3][3] * int cf50;
163[0][3] * * int cf51;
164[3][3] * * int cf52;
165[0][3] const * int cf53;
166[3][3] * const * int cf54;
167[0][3] const * const * int cf55;
168[3][3] const * const * int cf56;
169
170[int] cf65(int);
171[int] cf66(int);
172
173#pragma GCC diagnostic push
174#pragma GCC diagnostic ignored "-Wignored-qualifiers"
175
176[* int] cf67(int);
177[* * int] cf68(int);
178[const * * int] cf69(int);
179[const * const * int] cf70(int);
180
181#pragma GCC diagnostic pop
182
183// function pointer
184
185*[]*[]* [ *[]*[] int ]( *[]*[] int, *[]*[] int ) v3;
186#endif // __CFA__
187
188//Dummy main
189int main() {
190    printf("done\n");
191}
192
193// Local Variables: //
194// tab-width: 4 //
195// compile-command: "cfa variableDeclarator.cfa" //
196// End: //
Note: See TracBrowser for help on using the repository browser.