1 |
149 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-std=gnu99" } */
|
3 |
|
|
|
4 |
|
|
/* N1150 5.4: Usual arithmetic conversions.
|
5 |
|
|
C99 6.3.1.8[1] (New).
|
6 |
|
|
|
7 |
|
|
Test arithmetic operators between decimal float types and generic
|
8 |
|
|
float types, which are not allowed. */
|
9 |
|
|
|
10 |
|
|
extern _Decimal32 d32a, d32b;
|
11 |
|
|
extern _Decimal64 d64a, d64b;
|
12 |
|
|
extern _Decimal128 d128a, d128b;
|
13 |
|
|
extern float f;
|
14 |
|
|
extern double d;
|
15 |
|
|
extern long double ld;
|
16 |
|
|
|
17 |
|
|
extern signed int __attribute__ ((vector_size (16))) vi;
|
18 |
|
|
|
19 |
|
|
extern _Complex float cf;
|
20 |
|
|
extern _Complex double cd;
|
21 |
|
|
extern _Complex long double cld;
|
22 |
|
|
extern _Complex int ci;
|
23 |
|
|
|
24 |
|
|
void
|
25 |
|
|
foo (void)
|
26 |
|
|
{
|
27 |
|
|
/* Mixed operations with decimal and generic float operands. */
|
28 |
|
|
d32a = d32b + f; /* { dg-error "" "error.*mix operands of decimal float" } */
|
29 |
|
|
d32a = f * d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
30 |
|
|
d32a *= f; /* { dg-error "" "error.* mix operands of decimal float" } */
|
31 |
|
|
f += d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
32 |
|
|
d64a = d32a + d; /* { dg-error "" "error.* mix operands of decimal float" } */
|
33 |
|
|
d64a = d * d128a; /* { dg-error "" "error.* mix operands of decimal float" } */
|
34 |
|
|
d64a -= d; /* { dg-error "" "error.* mix operands of decimal float" } */
|
35 |
|
|
d128a = ld * d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
36 |
|
|
d128a = d64b + d; /* { dg-error "" "error.* mix operands of decimal float" } */
|
37 |
|
|
d128a *= f; /* { dg-error "" "error.* mix operands of decimal float" } */
|
38 |
|
|
|
39 |
|
|
/* Mixed operations with decimal float and a vector type. */
|
40 |
|
|
d64a = d64b + vi; /* { dg-error "" "error.* mix operands of decimal float" } */
|
41 |
|
|
d32a *= vi; /* { dg-error "" "error.* mix operands of decimal float" } */
|
42 |
|
|
d128a = vi - d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
43 |
|
|
|
44 |
|
|
/* Mixed operations with decimal float and Complex types. */
|
45 |
|
|
d32a += ci; /* { dg-error "" "error.* mix operands of decimal float" } */
|
46 |
|
|
d64a = ci * d32a; /* { dg-error "" "error.* mix operands of decimal float" } */
|
47 |
|
|
cd = d64a * cd; /* { dg-error "" "error.* mix operands of decimal float" } */
|
48 |
|
|
d128b = cld * d128b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
49 |
|
|
d32a = cf * d32b; /* { dg-error "" "error.* mix operands of decimal float" } */
|
50 |
|
|
}
|