x86: Tune Skylake, Cannonlake and Icelake as Haswell
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / complex-6.c
blob50fb18ea62ef2898ccd1ce733ff4e703ccff91f1
1 /* { dg-skip-if "requires io" { freestanding } } */
3 /* This test tests complex conjugate and passing/returning of
4 complex parameter. */
6 #include <stdlib.h>
7 #include <stdio.h>
9 int err;
11 #define TEST(TYPE, FUNC) \
12 __complex__ TYPE \
13 ctest_ ## FUNC (__complex__ TYPE x) \
14 { \
15 __complex__ TYPE res; \
17 res = ~x; \
19 return res; \
20 } \
22 void \
23 test_ ## FUNC (void) \
24 { \
25 __complex__ TYPE res, x; \
27 x = 1.0 + 2.0i; \
29 res = ctest_ ## FUNC (x); \
31 if (res != 1.0 - 2.0i) \
32 { \
33 printf ("test_" #FUNC " failed\n"); \
34 ++err; \
35 } \
39 TEST(float, float)
40 TEST(double, double)
41 TEST(long double, long_double)
42 TEST(int, int)
43 TEST(long int, long_int)
45 int
46 main (void)
49 err = 0;
51 test_float ();
52 test_double ();
53 test_long_double ();
54 test_int ();
55 test_long_int ();
57 if (err != 0)
58 abort ();
60 return 0;