1// RUN: %clang_cc1 -triple i686-pc-mingw32 -fms-extensions -Wmicrosoft %s -emit-llvm -o - | FileCheck %s
2
3class Test1 {
4public:
5   int a;
6};
7
8void f1() {
9  Test1 var;
10  var.Test1::Test1();
11
12  // CHECK:   call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 4, i32 4, i1 false)
13  var.Test1::Test1(var);
14}
15
16class Test2 {
17public:
18  Test2() { a = 10; b = 10; }
19   int a;
20   int b;
21};
22
23void f2() {
24  // CHECK:  %var = alloca %class.Test2, align 4
25  // CHECK-NEXT:  call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var)
26  Test2 var;
27
28  // CHECK-NEXT:  call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var)
29  var.Test2::Test2();
30
31  // CHECK:  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 8, i32 4, i1 false)
32  var.Test2::Test2(var);
33}
34
35
36
37
38class Test3 {
39public:
40  Test3() { a = 10; b = 15; c = 20; }
41  Test3(const Test3& that) { a = that.a; b = that.b; c = that.c; }
42   int a;
43   int b;
44   int c;
45};
46
47void f3() {
48  // CHECK: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var)
49  Test3 var;
50
51  // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var2)
52  Test3 var2;
53
54  // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var)
55  var.Test3::Test3();
56
57  // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1ERKS_(%class.Test3* %var, %class.Test3* dereferenceable({{[0-9]+}}) %var2)
58  var.Test3::Test3(var2);
59}
60