OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050119-2.c] - Diff between revs 297 and 338

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

Rev 297 Rev 338
/* PR middle-end/19874 */
/* PR middle-end/19874 */
typedef enum { A, B, C, D } E;
typedef enum { A, B, C, D } E;
 
 
struct S {
struct S {
  E __attribute__ ((mode (__byte__))) a;
  E __attribute__ ((mode (__byte__))) a;
  E __attribute__ ((mode (__byte__))) b;
  E __attribute__ ((mode (__byte__))) b;
  E __attribute__ ((mode (__byte__))) c;
  E __attribute__ ((mode (__byte__))) c;
  E __attribute__ ((mode (__byte__))) d;
  E __attribute__ ((mode (__byte__))) d;
};
};
 
 
extern void abort (void);
extern void abort (void);
extern void exit (int);
extern void exit (int);
 
 
E
E
foo (struct S *s)
foo (struct S *s)
{
{
  if (s->a != s->b)
  if (s->a != s->b)
    abort ();
    abort ();
  if (s->c != C)
  if (s->c != C)
    abort ();
    abort ();
  return s->d;
  return s->d;
}
}
 
 
int
int
main (void)
main (void)
{
{
  struct S s[2];
  struct S s[2];
  s[0].a = B;
  s[0].a = B;
  s[0].b = B;
  s[0].b = B;
  s[0].c = C;
  s[0].c = C;
  s[0].d = D;
  s[0].d = D;
  s[1].a = D;
  s[1].a = D;
  s[1].b = C;
  s[1].b = C;
  s[1].c = B;
  s[1].c = B;
  s[1].d = A;
  s[1].d = A;
  if (foo (s) != D)
  if (foo (s) != D)
    abort ();
    abort ();
  exit (0);
  exit (0);
}
}
 
 
 
 

powered by: WebSVN 2.1.0

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