Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / c-c++-common / torture / complex-sign-mul.c
bloba3274d2ea449dc52e844e8bffca25fe42360f740
1 /* Test complex arithmetic with signed zeros. Pure complex
2 multiplication. */
3 /* { dg-do run } */
4 /* { dg-options "-std=gnu99" { target c } } */
6 #include "complex-sign.h"
8 #define CHECK_MUL(TYPE, COPY, ZERO, ZEROI) \
9 do { \
10 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, +, +, +, +, +); \
11 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, +, +, -, +, +); \
12 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, +, -, +, -, +); \
13 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, +, -, -, +, -); \
14 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, -, +, +, +, +); \
15 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, -, +, -, +, -); \
16 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, -, -, +, +, +); \
17 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, +, -, -, -, -, +); \
18 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, +, +, +, -, +); \
19 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, +, +, -, +, +); \
20 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, +, -, +, +, -); \
21 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, +, -, -, +, +); \
22 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, -, +, +, +, -); \
23 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, -, +, -, -, +); \
24 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, -, -, +, +, +); \
25 CHECK_ARITH (TYPE, COPY, ZERO, ZEROI, *, -, -, -, -, +, +); \
26 } while (0)
28 void
29 check_mul_float (void)
31 #ifndef __SPU__
32 CHECK_MUL (float, __builtin_copysignf, 0.0f, 0.0if);
33 #endif
36 void
37 check_mul_double (void)
39 CHECK_MUL (double, __builtin_copysign, 0.0, 0.0i);
42 void
43 check_mul_long_double (void)
45 CHECK_MUL (long double, __builtin_copysignl, 0.0l, 0.0il);
48 int
49 main (void)
51 check_mul_float ();
52 check_mul_double ();
53 check_mul_long_double ();
54 exit (0);