annotate test/suite_aggrs/cases.c @ 454:68d98455a8bd

suite_aggrs: var scope change for older compilers; excluding msvc from tests with empty structs
author Tassilo Philipp
date Thu, 27 Jan 2022 14:48:51 +0100
parents 54c1dc2e6ea5
children 236015fdf7a8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
432
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
1 /*
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
2
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
3 Package: dyncall
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
4 Library: test
445
4bd3ed699de8 name fix
Tassilo Philipp
parents: 440
diff changeset
5 File: test/suite_aggrs/cases.c
432
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
6 Description:
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
7 License:
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
8
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
9 Copyright (c) 2022 Tassilo Philipp <tphilipp@potion-studios.com>
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
10
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
11 Permission to use, copy, modify, and distribute this software for any
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
12 purpose with or without fee is hereby granted, provided that the above
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
13 copyright notice and this permission notice appear in all copies.
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
14
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
15 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
16 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
17 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
18 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
22
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
23 */
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
24
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
25 #include "globals.h"
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
26
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
27 #define ret_v(X)
433
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
28 #define ret_c(X) return(K_c[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
29 #define ret_s(X) return(K_s[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
30 #define ret_i(X) return(K_i[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
31 #define ret_j(X) return(K_j[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
32 #define ret_l(X) return(K_l[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
33 #define ret_p(X) return(K_p[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
34 #define ret_f(X) return(K_f[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
35 #define ret_d(X) return(K_d[X]);
45662241d9cd suite_aggrs now handling struct by value return types, also
Tassilo Philipp
parents: 432
diff changeset
36 #define ret_a(X,t) return(*(t*)K_a[X]);
432
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
37
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
38 #define v void
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
39 #define c char
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
40 #define s short
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
41 #define i int
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
42 #define j long
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
43 #define l long long
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
44 #define p void*
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
45 #define f float
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
46 #define d double
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
47 #define a void* /* all generated aggregates */
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
48
440
e4ae6753a276 - simplified suite_aggr
Tassilo Philipp
parents: 433
diff changeset
49 #include "dyncall.h"
446
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
50
454
68d98455a8bd suite_aggrs: var scope change for older compilers; excluding msvc from tests with empty structs
Tassilo Philipp
parents: 446
diff changeset
51 #if defined(DC__C_MSVC) || defined(DC__OS_Plan9)
446
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
52 /* Plan9 pcc does not allow empty structs */
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
53 # include "nonemptystructs.h"
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
54 #else
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
55 # include "cases.h"
54c1dc2e6ea5 suite_aggrs: added knob to enable/disable generation of empty structs (some compilers like Plan9's pcc don't allow them)
Tassilo Philipp
parents: 445
diff changeset
56 #endif
432
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
57
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
58 int G_ncases = sizeof(G_sigtab)/sizeof(G_sigtab[0]);
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
59 int G_naggs = sizeof(G_agg_sigs)/sizeof(G_agg_sigs[0]);
167faab0c0be first usable version of test suite for aggregates, handling only non-nested struct params, at the moment;
Tassilo Philipp
parents:
diff changeset
60