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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [thunk1.C] - Blame information for rev 749

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

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Test that non-variadic function calls using thunks work right.
3
 
4
struct A {
5
  void* p;
6
  A (void* q): p (q) { }
7
  A (const A& a): p (a.p) { }
8
};
9
 
10
class CBase {
11
public:
12
  virtual void BaseFunc();
13
};
14
 
15
class MMixin {
16
public:
17
   virtual A MixinFunc(int arg, A arg2) = 0;
18
};
19
 
20
class CExample : public CBase, public MMixin {
21
public:
22
   A MixinFunc(int arg, A arg2);
23
};
24
 
25
void CBase::BaseFunc()
26
{
27
}
28
 
29
A CExample::MixinFunc(int arg, A arg2)
30
{
31
  if (arg != 1 || arg2.p != 0)
32
    return 0;
33
  return this;
34
}
35
 
36
void* test(MMixin& anExample)
37
{
38
  return anExample.MixinFunc(1,A(0)).p;
39
}
40
 
41
int main ()
42
{
43
  CExample c;
44
 
45
  if (test(c) != &c)
46
    return 1;
47
}

powered by: WebSVN 2.1.0

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