Anders Carlsson | 1851a12 | 2010-02-07 19:45:40 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s |
| 2 | |
| 3 | struct Field { |
| 4 | Field(); |
| 5 | ~Field(); |
| 6 | }; |
| 7 | |
| 8 | struct Base { |
| 9 | Base(); |
| 10 | ~Base(); |
| 11 | }; |
| 12 | |
| 13 | struct A : Base { |
| 14 | A(); |
| 15 | ~A(); |
| 16 | |
| 17 | virtual void f(); |
| 18 | |
| 19 | Field field; |
| 20 | }; |
| 21 | |
John McCall | 8e51a1f | 2010-02-18 21:31:48 +0000 | [diff] [blame^] | 22 | // CHECK: define void @_ZN1AC1Ev( |
Anders Carlsson | 1851a12 | 2010-02-07 19:45:40 +0000 | [diff] [blame] | 23 | // CHECK: call void @_ZN4BaseC2Ev( |
| 24 | // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2) |
| 25 | // CHECK: call void @_ZN5FieldC1Ev( |
| 26 | // CHECK: ret void |
| 27 | A::A() { } |
| 28 | |
John McCall | 8e51a1f | 2010-02-18 21:31:48 +0000 | [diff] [blame^] | 29 | // CHECK: define void @_ZN1AD1Ev( |
Anders Carlsson | 1851a12 | 2010-02-07 19:45:40 +0000 | [diff] [blame] | 30 | // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1A, i64 0, i64 2) |
| 31 | // CHECK: call void @_ZN5FieldD1Ev( |
| 32 | // CHECK: call void @_ZN4BaseD2Ev( |
| 33 | // CHECK: ret void |
| 34 | A::~A() { } |
| 35 | |
| 36 | struct B : Base { |
| 37 | virtual void f(); |
| 38 | |
| 39 | Field field; |
| 40 | }; |
| 41 | |
| 42 | void f() { B b; } |
| 43 | |
| 44 | // CHECK: define linkonce_odr void @_ZN1BC1Ev( |
| 45 | // CHECK: call void @_ZN4BaseC2Ev( |
| 46 | // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2) |
| 47 | // CHECK: call void @_ZN5FieldC1Ev |
| 48 | // CHECK: ret void |
| 49 | |
| 50 | // CHECK: define linkonce_odr void @_ZN1BD1Ev( |
| 51 | // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1B, i64 0, i64 2) |
| 52 | // CHECK: call void @_ZN5FieldD1Ev( |
| 53 | // CHECK: call void @_ZN4BaseD2Ev( |
| 54 | // CHECK: ret void |