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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* Verify that virtual call inlining does not pick a wrong method when
2
   there is a user defined ancestor in an object.  */
3
/* { dg-do run } */
4
/* { dg-options "-O3 -fdump-ipa-inline -fno-early-inlining -fno-ipa-cp"  } */
5
 
6
extern "C" void abort (void);
7
 
8
class A
9
{
10
public:
11
  int data;
12
  virtual int foo (int i);
13
};
14
 
15
class B : public A
16
{
17
public:
18
  class A confusion;
19
  virtual int foo (int i);
20
};
21
 
22
int A::foo (int i)
23
{
24
  return i + 1;
25
}
26
 
27
int B::foo (int i)
28
{
29
  return i + 2;
30
}
31
 
32
int middleman (class A *obj, int i)
33
{
34
  return obj->foo (i);
35
}
36
 
37
int __attribute__ ((noinline,noclone)) get_input(void)
38
{
39
  return 1;
40
}
41
 
42
int main (int argc, char *argv[])
43
{
44
  class B b;
45
  int i, j = get_input ();
46
 
47
  for (i = 0; i < j; i++)
48
    if ((middleman (&b, j) + 100 * middleman (&b.confusion, j)) != 203)
49
      abort ();
50
  return 0;
51
}
52
 
53
/* { dg-final { scan-ipa-dump "A::foo\[^\\n\]*inline copy in int main"  "inline"  } } */
54
/* { dg-final { scan-ipa-dump "B::foo\[^\\n\]*inline copy in int main"  "inline"  } } */
55
/* { dg-final { cleanup-ipa-dump "inline" } } */

powered by: WebSVN 2.1.0

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