diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c new file mode 100644 index 000000000..01d1fd119 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/complex-6.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized" } */ + +float +quantum_real(float _Complex a) +{ + float *p = (float *) &a; + return p[0]; +} +float +quantum_imag(float _Complex a) +{ + float *p = (float *) &a; + return p[1]; +} +float +quantum_foo(float _Complex a) +{ + float *p = (float *) &a; + return p[2]; +} + +/* { dg-final { scan-tree-dump-times "REALPART_EXPR" 1 "optimized" } } */ +/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |