Avoid repeated calls to temporarily_undo_changes [PR117297]
[official-gcc.git] / gcc / testsuite / c-c++-common / torture / complex-sign-mixed-add.c
blobc12ab6f1d535ba43d5f51bc8bdbb9cf6078e9115
1 /* Test complex arithmetic with signed zeros. Mixed real/complex
2 addition. */
3 /* { dg-do run } */
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) \
10 do { \
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, -, -); \
27 } while (0)
29 void
30 check_add_float (void)
32 CHECK_ADD (float, __builtin_copysignf, 0.0f, 0.0if);
35 void
36 check_add_double (void)
38 CHECK_ADD (double, __builtin_copysign, 0.0, 0.0i);
41 void
42 check_add_long_double (void)
44 CHECK_ADD (long double, __builtin_copysignl, 0.0l, 0.0il);
47 int
48 main (void)
50 check_add_float ();
51 check_add_double ();
52 check_add_long_double ();
53 exit (0);