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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [inline15.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR tree-optimization/40813
2
// { dg-do compile }
3
// { dg-options "-O -fcheck-new" }
4
 
5
typedef __SIZE_TYPE__ size_t;
6
typedef void *P;
7
struct A;
8
struct B
9
{
10
  void *b[5];
11
  A *foo () { return (A *) & b[0]; }
12
};
13
struct A
14
{
15
  void *operator new (size_t x, B &y) { return y.foo (); }
16
};
17
struct C : public A
18
{
19
  virtual int bar () { }
20
};
21
struct D : public C
22
{
23
  static B baz (unsigned *x) { B b; new (b) D (x); return b; }
24
  D (unsigned *x) { }
25
};
26
struct E
27
{
28
  B e;
29
  B fn (unsigned *a) { return D::baz (a); }
30
  E (P b, unsigned *a) : e (fn (a)) { }
31
};
32
 
33
static unsigned *
34
fn2 ()
35
{
36
}
37
 
38
void
39
test (P x)
40
{
41
  E (x, fn2 ());
42
}

powered by: WebSVN 2.1.0

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