OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [complex-3.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O -fdump-tree-optimized" } */
3
 
4
typedef _Complex float COMPLEX_FLOAT;
5
float real_part(COMPLEX_FLOAT a)
6
{
7
  return *(float*)(&a);
8
}
9
 
10
float real_part_2(COMPLEX_FLOAT a)
11
{
12
  return ((float*)(&a))[0];
13
}
14
 
15
 
16
float imag_part(COMPLEX_FLOAT a)
17
{
18
  return ((float*)(&a))[1];
19
}
20
 
21
/* Test that the above gets optimized to REALPART_EXPR and IMAGPART_EXPR
22
   respectively. */
23
 
24
/* { dg-final { scan-tree-dump-times "REALPART_EXPR" 2 "optimized" } } */
25
/* { dg-final { scan-tree-dump-times "IMAGPART_EXPR" 1 "optimized" } } */
26
/* { dg-final { cleanup-tree-dump "optimized" } } */
27
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.