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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [opt/] [nrv14.C] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
// PR c++/32992
2
// { dg-do run }
3
// { dg-options "-O2" }
4
 
5
extern "C" void abort (void);
6
 
7
struct A
8
{
9
  long int a1;
10
  long int a2;
11
  long int a3;
12
};
13
 
14
struct B
15
{
16
  long int f[3];
17
  operator A ()
18
  {
19
    union
20
    {
21
      long int t[3];
22
      A a;
23
    };
24
    for (int i = 0; i < 3; i++)
25
      t[i] = f[i];
26
    return a;
27
  }
28
};
29
 
30
int
31
main ()
32
{
33
  B b = { {1, 3, 5} };
34
  A a = b;
35
 
36
  if (a.a1 != b.f[0] || a.a2 != b.f[1] || a.a3 != b.f[2])
37
    abort ();
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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