1 /* { dg-do compile } */
2 /* { dg-options "-std=gnu99" } */
4 /* C99 6.5.4 Cast operators.
5 Test invalid casts involving decimal float. */
7 struct s { _Decimal32 d32; } sv;
8 union u { _Decimal32 d32; } uv;
21 (_Decimal32 []) d32p; /* { dg-error "cast specifies array type" } */
22 (_Decimal32 ()) d32p; /* { dg-error "cast specifies function type" } */
23 (_Decimal64 []) d64p; /* { dg-error "cast specifies array type" } */
24 (_Decimal64 ()) d64p; /* { dg-error "cast specifies function type" } */
25 (_Decimal128 []) d128p; /* { dg-error "cast specifies array type" } */
26 (_Decimal128 ()) d128p; /* { dg-error "cast specifies function type" } */
28 (struct s) d32; /* { dg-error "conversion to non-scalar type requested" } */
30 (struct s) d64; /* { dg-error "conversion to non-scalar type requested" } */
31 (union u) d64; /* { dg-error "cast to union type from type not present in union" } */
32 (struct s) d128; /* { dg-error "conversion to non-scalar type requested" } */
33 (union u) d128; /* { dg-error "cast to union type from type not present in union" } */
35 (_Decimal32) sv; /* { dg-error "aggregate value used where a float was expected" } */
36 (_Decimal32) uv; /* { dg-error "aggregate value used where a float was expected" } */
37 (_Decimal64) sv; /* { dg-error "aggregate value used where a float was expected" } */
38 (_Decimal64) uv; /* { dg-error "aggregate value used where a float was expected" } */
39 (_Decimal128) sv; /* { dg-error "aggregate value used where a float was expected" } */
40 (_Decimal128) uv; /* { dg-error "aggregate value used where a float was expected" } */