Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 | FileCheck %s |
Anders Carlsson | ce46052 | 2009-12-04 19:33:17 +0000 | [diff] [blame] | 2 | |
| 3 | struct A { |
| 4 | virtual ~A(); |
| 5 | }; |
| 6 | |
| 7 | struct B : A { |
| 8 | virtual ~B(); |
| 9 | }; |
| 10 | |
John McCall | 5c60a6f | 2010-02-18 19:59:28 +0000 | [diff] [blame^] | 11 | // Complete dtor: just an alias because there are no virtual bases. |
John McCall | 67cea74 | 2010-02-17 03:52:49 +0000 | [diff] [blame] | 12 | // CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev |
Anders Carlsson | e36a6b3 | 2010-01-02 01:01:18 +0000 | [diff] [blame] | 13 | |
John McCall | 5c60a6f | 2010-02-18 19:59:28 +0000 | [diff] [blame^] | 14 | // Deleting dtor: defers to the complete dtor. |
Anders Carlsson | ce46052 | 2009-12-04 19:33:17 +0000 | [diff] [blame] | 15 | // CHECK: define void @_ZN1BD0Ev |
John McCall | 5c60a6f | 2010-02-18 19:59:28 +0000 | [diff] [blame^] | 16 | // CHECK: call void @_ZN1BD1Ev |
| 17 | // CHECK: call void @_ZdlPv |
Anders Carlsson | ce46052 | 2009-12-04 19:33:17 +0000 | [diff] [blame] | 18 | |
John McCall | 5c60a6f | 2010-02-18 19:59:28 +0000 | [diff] [blame^] | 19 | // Base dtor: actually calls A's base dtor. |
Anders Carlsson | ce46052 | 2009-12-04 19:33:17 +0000 | [diff] [blame] | 20 | // CHECK: define void @_ZN1BD2Ev |
| 21 | // CHECK: call void @_ZN1AD2Ev |
| 22 | |
| 23 | B::~B() { } |