1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i686-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck %s
2
3 struct A {
AA4 A() : a(42) {}
AA5 A(const A &o) : a(o.a) {}
~AA6 ~A() {}
7 int a;
8 A foo(A o);
9 };
10
foo(A x)11 A A::foo(A x) {
12 A y(*this);
13 y.a += x.a;
14 return y;
15 }
16
17 // CHECK-LABEL: define x86_thiscallcc %struct.A* @"\01?foo@A@@QAE?AU1@U1@@Z"
18 // CHECK: (%struct.A* %this, <{ %struct.A*, %struct.A }>* inalloca)
19 // CHECK: getelementptr inbounds <{ %struct.A*, %struct.A }>* %{{.*}}, i32 0, i32 0
20 // CHECK: load %struct.A**
21 // CHECK: ret %struct.A*
22
main()23 int main() {
24 A x;
25 A y = x.foo(x);
26 }
27
28 // CHECK: call x86_thiscallcc %struct.A* @"\01?foo@A@@QAE?AU1@U1@@Z"
29 // CHECK: (%struct.A* %{{[^,]*}}, <{ %struct.A*, %struct.A }>* inalloca %{{[^,]*}})
30