1// { dg-do run { target fpic } }
2// { dg-options "-fPIC" }
3// { dg-bogus "\[Uu\]nresolved symbol .(_GLOBAL_OFFSET_TABLE_|\[_.A-Za-z\]\[_.0-9A-Za-z\]*@(PLT|GOT|GOTOFF))|\[Bb\]ad fixup at .DATA.:" "PIC unsupported" { xfail *-*-netware* } 0 }
4// Test that non-variadic function calls using thunks and PIC work right.
5
6struct A {
7  void* p;
8  A (void* q): p (q) { }
9  A (const A& a): p (a.p) { }
10};
11
12class CBase {
13public:
14  virtual void BaseFunc();
15};
16
17class MMixin {
18public:
19   virtual A MixinFunc(int arg, A arg2) = 0;
20};
21
22class CExample : public CBase, public MMixin {
23public:
24   A MixinFunc(int arg, A arg2);
25};
26
27void CBase::BaseFunc()
28{
29}
30
31A CExample::MixinFunc(int arg, A arg2)
32{
33  if (arg != 1 || arg2.p != 0)
34    return 0;
35  return this;
36}
37
38void* test(MMixin& anExample)
39{
40  return anExample.MixinFunc(1,A(0)).p;
41}
42
43main ()
44{
45  CExample c;
46
47  if (test(c) != &c)
48    return 1;
49}
50