1 /* Test complex arithmetic with signed zeros. Mixed real/complex
4 /* { dg-options "-std=gnu99" { target c } } */
5 /* { dg-skip-if "double support is incomplete" { "avr-*-*" } } */
7 #include "complex-sign.h"
9 #define CHECK_ADD(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_RC (TYPE, COPY, ZERO, ZEROI, +, -, -, -, -, -); \
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, +, -); \
26 CHECK_ARITH_CR (TYPE, COPY, ZERO, ZEROI, +, -, -, -, ZERO, -, -); \
30 check_add_float (void)
32 CHECK_ADD (float, __builtin_copysignf
, 0.0f
, 0.0if);
36 check_add_double (void)
38 CHECK_ADD (double, __builtin_copysign
, 0.0, 0.0i
);
42 check_add_long_double (void)
44 CHECK_ADD (long double, __builtin_copysignl
, 0.0l, 0.0il
);
52 check_add_long_double ();