Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / compat / scalar-by-value-dfp_y.c
blob9b1f49f69bd3b3cf377622905e3319705f9ea451
1 #include <stdarg.h>
3 #include "compat-common.h"
5 #ifdef SKIP_VA
6 const int test_va = 0;
7 #else
8 const int test_va = 1;
9 #endif
11 #define T(NAME, TYPE, INITVAL) \
12 extern TYPE g01##NAME, g02##NAME, g03##NAME, g04##NAME; \
13 extern TYPE g05##NAME, g06##NAME, g07##NAME, g08##NAME; \
14 extern TYPE g09##NAME, g10##NAME, g11##NAME, g12##NAME; \
15 extern TYPE g13##NAME, g14##NAME, g15##NAME, g16##NAME; \
17 extern void check##NAME (TYPE x, TYPE v); \
19 void \
20 init##NAME (TYPE *p, TYPE v) \
21 { \
22 *p = v + INITVAL; \
23 } \
25 void \
26 checkg##NAME (void) \
27 { \
28 check##NAME (g01##NAME, 1); \
29 check##NAME (g02##NAME, 2); \
30 check##NAME (g03##NAME, 3); \
31 check##NAME (g04##NAME, 4); \
32 check##NAME (g05##NAME, 5); \
33 check##NAME (g06##NAME, 6); \
34 check##NAME (g07##NAME, 7); \
35 check##NAME (g08##NAME, 8); \
36 check##NAME (g09##NAME, 9); \
37 check##NAME (g10##NAME, 10); \
38 check##NAME (g11##NAME, 11); \
39 check##NAME (g12##NAME, 12); \
40 check##NAME (g13##NAME, 13); \
41 check##NAME (g14##NAME, 14); \
42 check##NAME (g15##NAME, 15); \
43 check##NAME (g16##NAME, 16); \
44 } \
46 void \
47 test##NAME (TYPE x01, TYPE x02, TYPE x03, TYPE x04, \
48 TYPE x05, TYPE x06, TYPE x07, TYPE x08, \
49 TYPE x09, TYPE x10, TYPE x11, TYPE x12, \
50 TYPE x13, TYPE x14, TYPE x15, TYPE x16) \
51 { \
52 check##NAME (x01, 1); \
53 check##NAME (x02, 2); \
54 check##NAME (x03, 3); \
55 check##NAME (x04, 4); \
56 check##NAME (x05, 5); \
57 check##NAME (x06, 6); \
58 check##NAME (x07, 7); \
59 check##NAME (x08, 8); \
60 check##NAME (x09, 9); \
61 check##NAME (x10, 10); \
62 check##NAME (x11, 11); \
63 check##NAME (x12, 12); \
64 check##NAME (x13, 13); \
65 check##NAME (x14, 14); \
66 check##NAME (x15, 15); \
67 check##NAME (x16, 16); \
68 } \
70 void \
71 testva##NAME (int n, ...) \
72 { \
73 int i; \
74 va_list ap; \
75 if (test_va) \
76 { \
77 va_start (ap, n); \
78 for (i = 0; i < n; i++) \
79 { \
80 TYPE t = va_arg (ap, TYPE); \
81 check##NAME (t, i+1); \
82 } \
83 va_end (ap); \
84 } \
87 T(d32, _Decimal32, 1.2df)
88 T(d64, _Decimal64, 12.34dd)
89 T(d128, _Decimal128, 123.456dl)