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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [sra-1.c] - Diff between revs 297 and 384

Only display areas with differences | Details | Blame | View Log

Rev 297 Rev 384
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "-O1" } */
/* { dg-options "-O1" } */
/* Let gimple verifier check what SRA does to unions and single-field
/* Let gimple verifier check what SRA does to unions and single-field
   strucutres . */
   strucutres . */
 
 
struct sim_struct
struct sim_struct
{
{
  int x;
  int x;
};
};
 
 
extern struct sim_struct get_x(void);
extern struct sim_struct get_x(void);
 
 
struct sim_struct foo (void)
struct sim_struct foo (void)
{
{
  struct sim_struct simple;
  struct sim_struct simple;
 
 
  simple = get_x ();
  simple = get_x ();
  if (simple.x % 2)
  if (simple.x % 2)
    simple.x = 39;
    simple.x = 39;
  else
  else
    simple.x -=8;
    simple.x -=8;
 
 
  return simple;
  return simple;
}
}
 
 
struct sim_cmplx
struct sim_cmplx
{
{
  _Complex double c;
  _Complex double c;
};
};
 
 
extern struct sim_cmplx get_sc (void);
extern struct sim_cmplx get_sc (void);
 
 
_Complex double foo_c (void)
_Complex double foo_c (void)
{
{
  struct sim_cmplx simple;
  struct sim_cmplx simple;
 
 
  simple = get_sc ();
  simple = get_sc ();
  if (__real__ simple.c > 200.3)
  if (__real__ simple.c > 200.3)
    __imag__ simple.c -= 2.4;
    __imag__ simple.c -= 2.4;
 
 
  return simple.c;
  return simple.c;
}
}
 
 
 
 
union sim_union
union sim_union
{
{
  int i;
  int i;
  float d;
  float d;
};
};
 
 
extern union sim_union get_y (void);
extern union sim_union get_y (void);
 
 
union sim_union bar (void)
union sim_union bar (void)
{
{
  union sim_union simple;
  union sim_union simple;
 
 
  simple = get_y ();
  simple = get_y ();
  if (simple.d > 8.2)
  if (simple.d > 8.2)
    simple.i = 300;
    simple.i = 300;
 
 
  return simple;
  return simple;
}
}
 
 
extern int get_int (void);
extern int get_int (void);
 
 
int bar_i (void)
int bar_i (void)
{
{
  union sim_union simple;
  union sim_union simple;
 
 
  simple = get_y ();
  simple = get_y ();
  if (simple.d > 8.2)
  if (simple.d > 8.2)
    simple.i = get_int ();
    simple.i = get_int ();
 
 
  return simple.i;
  return simple.i;
}
}
 
 

powered by: WebSVN 2.1.0

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