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.2.2/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr26258.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do run } */
2
 
3
extern void abort(void);
4
 
5
typedef struct Foo { int a; int b; }  Foo;
6
 
7
Foo foo(Foo first, Foo last, _Bool ret_first)
8
{
9
  Foo t;
10
  Foo *t1 = (ret_first ? &first : &last);
11
  first.a = 2;
12
  last.b = 3;
13
  t.a = t1->a;
14
  t.b = t1->b;
15
  t.a += first.a;
16
  t.b += last.b;
17
  return t;
18
}
19
 
20
int main()
21
{
22
  Foo first = (Foo){1, 2};
23
  Foo last = (Foo){3, 4};
24
  Foo ret = foo(first, last, 0);
25
  if (ret.b != 6)
26
    abort ();
27
  return 0;
28
}

powered by: WebSVN 2.1.0

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