Daniel Dunbar | 8e26222 | 2011-01-18 05:36:08 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -Wmicrosoft %s -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | class Test1 { |
| 4 | public: |
| 5 | int a; |
| 6 | }; |
| 7 | |
| 8 | void 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 | |
| 16 | class Test2 { |
| 17 | public: |
| 18 | Test2() { a = 10; b = 10; } |
| 19 | int a; |
| 20 | int b; |
| 21 | }; |
| 22 | |
| 23 | void f2() { |
| 24 | // CHECK: %var = alloca %class.Test2, align 4 |
| 25 | // CHECK-NEXT: call void @_ZN5Test2C1Ev(%class.Test2* %var) |
| 26 | Test2 var; |
| 27 | |
| 28 | // CHECK-NEXT: call 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 | |
| 38 | class Test3 { |
| 39 | public: |
| 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 | |
| 47 | void f3() { |
| 48 | // CHECK: call void @_ZN5Test3C1Ev(%class.Test3* %var) |
| 49 | Test3 var; |
| 50 | |
| 51 | // CHECK-NEXT: call void @_ZN5Test3C1Ev(%class.Test3* %var2) |
| 52 | Test3 var2; |
| 53 | |
| 54 | // CHECK-NEXT: call void @_ZN5Test3C1Ev(%class.Test3* %var) |
| 55 | var.Test3::Test3(); |
| 56 | |
| 57 | // CHECK-NEXT: call void @_ZN5Test3C1ERKS_(%class.Test3* %var, %class.Test3* %var2) |
| 58 | var.Test3::Test3(var2); |
| 59 | } |
| 60 | |