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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20000603-1.c] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* It is not clear whether this test is conforming.  See DR#236
2
   http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_236.htm.  However,
3
   there seems to be consensus that the presence of a union to aggregate
4
   struct s1 and struct s2 should make it conforming.  */
5
struct s1 { double d; };
6
struct s2 { double d; };
7
union u { struct s1 x; struct s2 y; };
8
 
9
double f(struct s1 *a, struct s2 *b)
10
{
11
  a->d = 1.0;
12
  return b->d + 1.0;
13
}
14
 
15
int main()
16
{
17
  union u a;
18
  a.x.d = 0.0;
19
  if (f (&a.x, &a.y) != 2.0)
20
    abort ();
21
  return 0;
22
}

powered by: WebSVN 2.1.0

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