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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr26258.c] - Diff between revs 149 and 154

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* { dg-do run } */
/* { dg-do run } */
 
 
extern void abort(void);
extern void abort(void);
 
 
typedef struct Foo { int a; int b; }  Foo;
typedef struct Foo { int a; int b; }  Foo;
 
 
Foo foo(Foo first, Foo last, _Bool ret_first)
Foo foo(Foo first, Foo last, _Bool ret_first)
{
{
  Foo t;
  Foo t;
  Foo *t1 = (ret_first ? &first : &last);
  Foo *t1 = (ret_first ? &first : &last);
  first.a = 2;
  first.a = 2;
  last.b = 3;
  last.b = 3;
  t.a = t1->a;
  t.a = t1->a;
  t.b = t1->b;
  t.b = t1->b;
  t.a += first.a;
  t.a += first.a;
  t.b += last.b;
  t.b += last.b;
  return t;
  return t;
}
}
 
 
int main()
int main()
{
{
  Foo first = (Foo){1, 2};
  Foo first = (Foo){1, 2};
  Foo last = (Foo){3, 4};
  Foo last = (Foo){3, 4};
  Foo ret = foo(first, last, 0);
  Foo ret = foo(first, last, 0);
  if (ret.b != 6)
  if (ret.b != 6)
    abort ();
    abort ();
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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