1 /* { dg-do compile } */
3 /* N1150 3: Decimal floating types.
4 C99 6.7.2: Type specifiers */
6 /* Test for the existence of the types. */
13 static _Decimal32 d32
[ARRAY_SIZE
];
14 static _Decimal64 d64
[ARRAY_SIZE
];
15 static _Decimal128 d128
[ARRAY_SIZE
];
17 extern _Decimal32 ext_d32
[ARRAY_SIZE
];
18 extern _Decimal64 ext_d64
[ARRAY_SIZE
];
19 extern _Decimal128 ext_d128
[ARRAY_SIZE
];
21 /* Test sizes for these types. */
22 int ssize
[sizeof (_Decimal32
) == 4 ? 1 : -1];
23 int dsize
[sizeof (_Decimal64
) == 8 ? 1 : -1];
24 int tsize
[sizeof (_Decimal128
) == 16 ? 1 : -1];
26 int salign
= __alignof (_Decimal32
);
27 int dalign
= __alignof (_Decimal64
);
28 int talign
= __alignof (_Decimal128
);
30 /* sizeof operator applied on an array of DFP types is n times the
31 size of a single variable of this type. */
33 int d32_array_size
[sizeof(d32
) == ARRAY_SIZE
* sizeof(sd1
) ? 1 : -1];
34 int d64_array_size
[sizeof(d64
) == ARRAY_SIZE
* sizeof(dd2
) ? 1 : -1];
35 int d128_array_size
[sizeof(d128
) == ARRAY_SIZE
* sizeof(td3
)? 1 : -1];
37 /* Likewise for extern qualified arrays. */
39 int ext_d32_array_size
[sizeof(ext_d32
) == ARRAY_SIZE
* sizeof(sd1
) ? 1 : -1];
40 int ext_d64_array_size
[sizeof(ext_d64
) == ARRAY_SIZE
* sizeof(dd2
) ? 1 : -1];
41 int ext_d128_array_size
[sizeof(ext_d128
) == ARRAY_SIZE
* sizeof(td3
)? 1 : -1];
45 _Decimal32 d32
[ARRAY_SIZE
];
46 _Decimal64 d64
[ARRAY_SIZE
];
47 _Decimal128 d128
[ARRAY_SIZE
];
49 int d32_array_size
[sizeof(d32
) == ARRAY_SIZE
* sizeof(_Decimal32
) ? 1 : -1];
50 int d64_array_size
[sizeof(d64
) == ARRAY_SIZE
* sizeof(_Decimal64
) ? 1 : -1];
51 int d128_array_size
[sizeof(d128
) == ARRAY_SIZE
* sizeof(_Decimal128
)? 1 : -1];