xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/microsoft-abi-nontrivial-covariant-thunk.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 %s -fno-rtti -emit-llvm-only -o - -triple=i386-pc-win32 -verify
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc // A is not trivially copyable and must be passed indirectly or with inalloca.
4*0a6a1f1dSLionel Sambuc struct A {
5*0a6a1f1dSLionel Sambuc   A();
6*0a6a1f1dSLionel Sambuc   A(const A &o);
7*0a6a1f1dSLionel Sambuc   virtual ~A();
8*0a6a1f1dSLionel Sambuc   int a;
9*0a6a1f1dSLionel Sambuc };
10*0a6a1f1dSLionel Sambuc 
11*0a6a1f1dSLionel Sambuc struct B {
12*0a6a1f1dSLionel Sambuc   B();
13*0a6a1f1dSLionel Sambuc   int b;
14*0a6a1f1dSLionel Sambuc   virtual B *clone(A);
15*0a6a1f1dSLionel Sambuc };
16*0a6a1f1dSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc // Converting from C* to B* requires a this adjustment.
18*0a6a1f1dSLionel Sambuc struct C : A, B {
19*0a6a1f1dSLionel Sambuc   C();
20*0a6a1f1dSLionel Sambuc   int c;
21*0a6a1f1dSLionel Sambuc   virtual C *clone(A); // expected-error {{cannot compile this non-trivial argument copy for return-adjusting thunk yet}}
22*0a6a1f1dSLionel Sambuc };
B()23*0a6a1f1dSLionel Sambuc B::B() {}  // force emission
C()24*0a6a1f1dSLionel Sambuc C::C() {}  // force emission
25