1 /* Test complex arithmetic with signed zeros. Mixed real/complex
4 /* { dg-options "-std=gnu99" { target c } } */
6 #include "complex-sign.h"
8 #define CHECK_MUL(TYPE, COPY, ZERO, ZEROI) \
10 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, +, +, +, +, +); \
11 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, +, +, -, +, -); \
12 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, +, -, +, -, +); \
13 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, +, -, -, -, -); \
14 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, -, +, +, -, -); \
15 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, -, +, -, -, +); \
16 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, -, -, +, +, -); \
17 CHECK_ARITH_RC (TYPE, COPY, ZERO, ZEROI, *, -, -, -, +, +); \
18 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, +, +, +, ZERO, +, +); \
19 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, +, +, -, ZERO, -, -); \
20 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, +, -, +, ZERO, +, -); \
21 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, +, -, -, ZERO, -, +); \
22 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, -, +, +, ZERO, -, +); \
23 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, -, +, -, ZERO, +, -); \
24 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, -, -, +, ZERO, -, -); \
25 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, *, -, -, -, ZERO, +, +); \
29 check_mul_float (void)
32 CHECK_MUL (float, __builtin_copysignf
, 0.0f
, 0.0if);
37 check_mul_double (void)
39 CHECK_MUL (double, __builtin_copysign
, 0.0, 0.0i
);
43 check_mul_long_double (void)
45 CHECK_MUL (long double, __builtin_copysignl
, 0.0l, 0.0il
);
53 check_mul_long_double ();