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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr48661.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// PR middle-end/48661
2
// { dg-do run }
3
 
4
extern "C" void abort ();
5
 
6
__attribute__((noinline))
7
double
8
foo (double x, double y)
9
{
10
  asm volatile ("" : : : "memory");
11
  return x + y;
12
}
13
 
14
__attribute__((noinline, noclone))
15
void
16
bar (int x)
17
{
18
  if (x != 123)
19
    abort ();
20
}
21
 
22
struct A
23
{
24
  double a1, a2;
25
};
26
 
27
struct B
28
{
29
  virtual int m () const = 0 ;
30
};
31
 
32
struct C
33
{
34
  virtual ~C () {}
35
};
36
 
37
struct D : virtual public B, public C
38
{
39
  explicit D (const A &x) : d(123) { foo (x.a2, x.a1); }
40
  int m () const { return d; }
41
  int d;
42
};
43
 
44
struct E
45
{
46
  E () : d(0) {}
47
  virtual void n (const B &x) { d = x.m (); x.m (); x.m (); }
48
  int d;
49
};
50
 
51
void
52
test ()
53
{
54
  A a;
55
  a.a1 = 0;
56
  a.a2 = 1;
57
  E p;
58
  D q (a);
59
  const B &b = q;
60
  bar (b.m ());
61
  p.n (b);
62
  bar (p.d);
63
}
64
 
65
void
66
baz ()
67
{
68
  A a;
69
  D p2 (a);
70
}
71
 
72
int
73
main ()
74
{
75
  test ();
76
  return 0;
77
}

powered by: WebSVN 2.1.0

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