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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.dg/] [opt/] [thunk1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR 6788
2
// Test that the thunk adjusts the this pointer properly.
3
// { dg-do run }
4
 
5
extern "C" void abort ();
6
 
7
struct A
8
{
9
  virtual void foo() = 0;
10
  char large[33*1024];
11
};
12
 
13
struct B
14
{
15
  virtual void foo() = 0;
16
};
17
 
18
struct C : public A, public B
19
{
20
  virtual void foo();
21
};
22
 
23
static C *match;
24
 
25
void C::foo()
26
{
27
  if (this != match)
28
    abort ();
29
}
30
 
31
void bar(B *x)
32
{
33
  x->foo();
34
}
35
 
36
int main()
37
{
38
  C obj;
39
  match = &obj;
40
  bar(&obj);
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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