Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / complex-3.c
blob558b9785a5c1034be52a1cda3af1d69fa446eef3
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-optimized" } */
4 typedef _Complex float COMPLEX_FLOAT;
5 float real_part(COMPLEX_FLOAT a)
7 return *(float*)(&a);
10 float real_part_2(COMPLEX_FLOAT a)
12 return ((float*)(&a))[0];
16 float imag_part(COMPLEX_FLOAT a)
18 return ((float*)(&a))[1];
21 /* Test that the above gets optimized to REALPART_EXPR and IMAGPART_EXPR
22 respectively. */
24 /* { dg-final { scan-tree-dump-times "REALPART_EXPR" 2 "optimized" } } */
25 /* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */