repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
opt
/
thunk1.C
blob
566c0f2fcc5d8e7ce6a9d0c290e63aa94c2b0570
1
// 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
}